fix perf. bug in wake-up load balancing for aim7 and db workload
PATCH 2/2 fix perf. bug in wake-up load balancing for aim7 and db workload
Add sysctl to control wake-balance behavior.
Signed-off-by Ken Chen <[email protected]>
include/linux/sysctl.h renamed from include/linux/sysctl.h.orig +1 -0
@@ -146,6 +146,7 @@ enumKERN_RANDOMIZE =68 ,/* int: randomize virtual address space */ KERN_SETUID_DUMPABLE =69 ,/* int: behaviour of dumps for setuid core */ KERN_SPIN_RETRY =70 ,/* int: number of spinlock retries */ + KERN_WAKE_BALANCE=71, /* int: load balance on wakeup */ };
kernel/sched.c renamed from kernel/sched.c.orig +5 -0
@@ -1237,6 +1237,8 @@ static inline int wake_idle(int cpu, tas }#endif +int sysctl_wake_balance=1 ; +/*** * try_to_wake_up - wake up a thread * @p: the to-be-woken-up thread
@@ -1294,6 +1296,9 @@ static int try_to_wake_up(task_t *p, uns } } +if (!sysctl_wake_balance) + goto out_activate; +if (unlikely (!cpu_isset (this_cpu, p->cpus_allowed))) goto out_set_cpu;
kernel/sysctl.c renamed from kernel/sysctl.c.orig +9 -0
@@ -71,6 +71,7 @@ extern int printk_ratelimit_burst;extern int pid_max_min, pid_max_max;extern int sysctl_drop_caches;extern int percpu_pagelist_fraction; +extern int sysctl_wake_balance;#if defined(CONFIG_X86_LOCAL_APIC ) && defined(CONFIG_X86 )int unknown_nmi_panic;
@@ -658,6 +659,14 @@ static ctl_table kern_table[] = { .proc_handler = &proc_dointvec, },#endif + { + .ctl_name = KERN_WAKE_BALANCE, + .procname = "wake_balance", + .data = &sysctl_wake_balance, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, + }, { .ctl_name = 0 } };