From: Linus Torvalds Date: Fri, 18 Sep 2009 04:00:02 +0000 (-0700) Subject: Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel... X-Git-Tag: v2.6.32-rc1~652 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=dcbf77b9e86e1726f5fbd01bb98820dac06d456e;p=linux-block.git Merge branch 'sched-core-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip * 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (37 commits) sched: Fix SD_POWERSAVING_BALANCE|SD_PREFER_LOCAL vs SD_WAKE_AFFINE sched: Stop buddies from hogging the system sched: Add new wakeup preemption mode: WAKEUP_RUNNING sched: Fix TASK_WAKING & loadaverage breakage sched: Disable wakeup balancing sched: Rename flags to wake_flags sched: Clean up the load_idx selection in select_task_rq_fair sched: Optimize cgroup vs wakeup a bit sched: x86: Name old_perf in a unique way sched: Implement a gentler fair-sleepers feature sched: Add SD_PREFER_LOCAL sched: Add a few SYNC hint knobs to play with sched: Fix sync wakeups again sched: Add WF_FORK sched: Rename sync arguments sched: Rename select_task_rq() argument sched: Feature to disable APERF/MPERF cpu_power x86: sched: Provide arch implementations using aperf/mperf x86: Add generic aperf/mperf code x86: Move APERF/MPERF into a X86_FEATURE ... Fix up trivial conflict in arch/x86/include/asm/processor.h due to nearby addition of amd_get_nb_id() declaration from the EDAC merge. --- dcbf77b9e86e1726f5fbd01bb98820dac06d456e diff --cc arch/x86/include/asm/processor.h index 42a3f936dadc,4ae2ccfed638..c3429e8b2424 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@@ -1020,6 -1021,33 +1021,35 @@@ extern void start_thread(struct pt_reg extern int get_tsc_mode(unsigned long adr); extern int set_tsc_mode(unsigned int val); +extern int amd_get_nb_id(int cpu); + + struct aperfmperf { + u64 aperf, mperf; + }; + + static inline void get_aperfmperf(struct aperfmperf *am) + { + WARN_ON_ONCE(!boot_cpu_has(X86_FEATURE_APERFMPERF)); + + rdmsrl(MSR_IA32_APERF, am->aperf); + rdmsrl(MSR_IA32_MPERF, am->mperf); + } + + #define APERFMPERF_SHIFT 10 + + static inline + unsigned long calc_aperfmperf_ratio(struct aperfmperf *old, + struct aperfmperf *new) + { + u64 aperf = new->aperf - old->aperf; + u64 mperf = new->mperf - old->mperf; + unsigned long ratio = aperf; + + mperf >>= APERFMPERF_SHIFT; + if (mperf) + ratio = div64_u64(aperf, mperf); + + return ratio; + } + #endif /* _ASM_X86_PROCESSOR_H */