Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
sched: optimize sched_clock() a bit
sched: improve sched_clock() performance

+8 -4
-2
arch/x86/include/asm/msr.h
··· 108 108 { 109 109 DECLARE_ARGS(val, low, high); 110 110 111 - rdtsc_barrier(); 112 111 asm volatile("rdtsc" : EAX_EDX_RET(val, low, high)); 113 - rdtsc_barrier(); 114 112 115 113 return EAX_EDX_VAL(val, low, high); 116 114 }
+7 -1
arch/x86/include/asm/tsc.h
··· 34 34 35 35 static __always_inline cycles_t vget_cycles(void) 36 36 { 37 + cycles_t cycles; 38 + 37 39 /* 38 40 * We only do VDSOs on TSC capable CPUs, so this shouldnt 39 41 * access boot_cpu_data (which is not VDSO-safe): ··· 44 42 if (!cpu_has_tsc) 45 43 return 0; 46 44 #endif 47 - return (cycles_t)__native_read_tsc(); 45 + rdtsc_barrier(); 46 + cycles = (cycles_t)__native_read_tsc(); 47 + rdtsc_barrier(); 48 + 49 + return cycles; 48 50 } 49 51 50 52 extern void tsc_init(void);
+1 -1
arch/x86/kernel/tsc.c
··· 55 55 rdtscll(this_offset); 56 56 57 57 /* return the value in ns */ 58 - return cycles_2_ns(this_offset); 58 + return __cycles_2_ns(this_offset); 59 59 } 60 60 61 61 /* We need to define a real function for sched_clock, to override the