Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/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.
This commit is contained in:
@@ -96,6 +96,7 @@
|
||||
#define X86_FEATURE_CLFLUSH_MONITOR (3*32+25) /* "" clflush reqd with monitor */
|
||||
#define X86_FEATURE_EXTD_APICID (3*32+26) /* has extended APICID (8 bits) */
|
||||
#define X86_FEATURE_AMD_DCM (3*32+27) /* multi-node processor */
|
||||
#define X86_FEATURE_APERFMPERF (3*32+28) /* APERFMPERF */
|
||||
|
||||
/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
|
||||
#define X86_FEATURE_XMM3 (4*32+ 0) /* "pni" SSE-3 */
|
||||
|
@@ -27,6 +27,7 @@ struct mm_struct;
|
||||
#include <linux/cpumask.h>
|
||||
#include <linux/cache.h>
|
||||
#include <linux/threads.h>
|
||||
#include <linux/math64.h>
|
||||
#include <linux/init.h>
|
||||
|
||||
/*
|
||||
@@ -1022,4 +1023,33 @@ 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 */
|
||||
|
@@ -116,15 +116,11 @@ extern unsigned long node_remap_size[];
|
||||
|
||||
# define SD_CACHE_NICE_TRIES 1
|
||||
# define SD_IDLE_IDX 1
|
||||
# define SD_NEWIDLE_IDX 2
|
||||
# define SD_FORKEXEC_IDX 0
|
||||
|
||||
#else
|
||||
|
||||
# define SD_CACHE_NICE_TRIES 2
|
||||
# define SD_IDLE_IDX 2
|
||||
# define SD_NEWIDLE_IDX 2
|
||||
# define SD_FORKEXEC_IDX 1
|
||||
|
||||
#endif
|
||||
|
||||
@@ -137,22 +133,20 @@ extern unsigned long node_remap_size[];
|
||||
.cache_nice_tries = SD_CACHE_NICE_TRIES, \
|
||||
.busy_idx = 3, \
|
||||
.idle_idx = SD_IDLE_IDX, \
|
||||
.newidle_idx = SD_NEWIDLE_IDX, \
|
||||
.wake_idx = 1, \
|
||||
.forkexec_idx = SD_FORKEXEC_IDX, \
|
||||
.newidle_idx = 0, \
|
||||
.wake_idx = 0, \
|
||||
.forkexec_idx = 0, \
|
||||
\
|
||||
.flags = 1*SD_LOAD_BALANCE \
|
||||
| 1*SD_BALANCE_NEWIDLE \
|
||||
| 1*SD_BALANCE_EXEC \
|
||||
| 1*SD_BALANCE_FORK \
|
||||
| 0*SD_WAKE_IDLE \
|
||||
| 0*SD_BALANCE_WAKE \
|
||||
| 1*SD_WAKE_AFFINE \
|
||||
| 1*SD_WAKE_BALANCE \
|
||||
| 0*SD_SHARE_CPUPOWER \
|
||||
| 0*SD_POWERSAVINGS_BALANCE \
|
||||
| 0*SD_SHARE_PKG_RESOURCES \
|
||||
| 1*SD_SERIALIZE \
|
||||
| 1*SD_WAKE_IDLE_FAR \
|
||||
| 0*SD_PREFER_SIBLING \
|
||||
, \
|
||||
.last_balance = jiffies, \
|
||||
|
Reference in New Issue
Block a user