Add the interactive tunable for the staircase cpu scheduler. The default behaviour is for nice value to determine cpu proportion only, and wakeup latency is determined by the percentage of the cpu entitlement of a task. The interactive tunable modifies this behaviour such that nice value determines both cpu proportion and wakeup latency. Signed-off-by: Con Kolivas Documentation/sysctl/kernel.txt | 10 ++++++++++ include/linux/sched.h | 1 + kernel/sched.c | 8 +++++++- kernel/sysctl.c | 8 ++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) Index: linux-2.6.20-ck1/include/linux/sched.h =================================================================== --- linux-2.6.20-ck1.orig/include/linux/sched.h 2007-02-16 19:01:30.000000000 +1100 +++ linux-2.6.20-ck1/include/linux/sched.h 2007-02-16 19:01:30.000000000 +1100 @@ -216,6 +216,7 @@ extern void show_stack(struct task_struc void io_schedule(void); long io_schedule_timeout(long timeout); +extern int sched_interactive; extern void cpu_init (void); extern void trap_init(void); Index: linux-2.6.20-ck1/kernel/sysctl.c =================================================================== --- linux-2.6.20-ck1.orig/kernel/sysctl.c 2007-02-05 22:52:04.000000000 +1100 +++ linux-2.6.20-ck1/kernel/sysctl.c 2007-02-16 19:01:30.000000000 +1100 @@ -676,6 +676,14 @@ static ctl_table kern_table[] = { .mode = 0444, .proc_handler = &proc_dointvec, }, + { + .ctl_name = CTL_UNNUMBERED, + .procname = "interactive", + .data = &sched_interactive, + .maxlen = sizeof (int), + .mode = 0644, + .proc_handler = &proc_dointvec, + }, #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) { .ctl_name = KERN_UNKNOWN_NMI_PANIC, Index: linux-2.6.20-ck1/kernel/sched.c =================================================================== --- linux-2.6.20-ck1.orig/kernel/sched.c 2007-02-16 19:01:30.000000000 +1100 +++ linux-2.6.20-ck1/kernel/sched.c 2007-02-16 19:01:30.000000000 +1100 @@ -61,6 +61,12 @@ #include /* + * sched_interactive - sysctl which allows interactive tasks to have bonus + * raise its priority. + */ +int sched_interactive __read_mostly = 1; + +/* * Convert user-nice values [ -20 ... 0 ... 19 ] * to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ], * and back. @@ -867,7 +873,7 @@ static inline int __normal_prio(struct t best_bonus = bonus(p); prio = MAX_RT_PRIO + best_bonus; - if (!batch_task(p)) + if (sched_interactive && !batch_task(p)) prio -= p->bonus; rr = rr_interval(p); Index: linux-2.6.20-ck1/Documentation/sysctl/kernel.txt =================================================================== --- linux-2.6.20-ck1.orig/Documentation/sysctl/kernel.txt 2007-02-05 22:51:59.000000000 +1100 +++ linux-2.6.20-ck1/Documentation/sysctl/kernel.txt 2007-02-16 19:01:30.000000000 +1100 @@ -25,6 +25,7 @@ show up in /proc/sys/kernel: - domainname - hostname - hotplug +- interactive - java-appletviewer [ binfmt_java, obsolete ] - java-interpreter [ binfmt_java, obsolete ] - kstack_depth_to_print [ X86 only ] @@ -164,6 +165,15 @@ Default value is "/sbin/hotplug". ============================================================== +interactive: + +This flag controls the allocation of dynamic priorities in the cpu +scheduler. It gives low cpu using tasks high priority for lowest +latencies. Nice value is still observed but stricter cpu proportions +are obeyed if this tunable is disabled. Enabled by default. + +============================================================== + l2cr: (PPC only) This flag controls the L2 cache of G3 processor boards. If