include/linux/sched.h | 1 + include/linux/sysctl.h | 1 + kernel/sched.c | 8 +++++++- kernel/sysctl.c | 8 ++++++++ 4 files changed, 17 insertions(+), 1 deletion(-) Index: linux-2.6.17-rc1/include/linux/sched.h =================================================================== --- linux-2.6.17-rc1.orig/include/linux/sched.h 2006-04-04 16:49:08.000000000 +1000 +++ linux-2.6.17-rc1/include/linux/sched.h 2006-04-04 16:49:38.000000000 +1000 @@ -201,6 +201,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.17-rc1/include/linux/sysctl.h =================================================================== --- linux-2.6.17-rc1.orig/include/linux/sysctl.h 2006-04-04 16:49:05.000000000 +1000 +++ linux-2.6.17-rc1/include/linux/sysctl.h 2006-04-04 16:49:38.000000000 +1000 @@ -148,6 +148,7 @@ enum KERN_SPIN_RETRY=70, /* int: number of spinlock retries */ KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */ KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */ + KERN_INTERACTIVE=73, /* interactive tasks can have cpu bursts */ }; Index: linux-2.6.17-rc1/kernel/sysctl.c =================================================================== --- linux-2.6.17-rc1.orig/kernel/sysctl.c 2006-04-04 16:49:05.000000000 +1000 +++ linux-2.6.17-rc1/kernel/sysctl.c 2006-04-04 16:49:38.000000000 +1000 @@ -623,6 +623,14 @@ static ctl_table kern_table[] = { .mode = 0444, .proc_handler = &proc_dointvec, }, + { + .ctl_name = KERN_INTERACTIVE, + .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.17-rc1/kernel/sched.c =================================================================== --- linux-2.6.17-rc1.orig/kernel/sched.c 2006-04-04 16:49:33.000000000 +1000 +++ linux-2.6.17-rc1/kernel/sched.c 2006-04-04 16:49:38.000000000 +1000 @@ -58,6 +58,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. @@ -653,7 +659,7 @@ static int effective_prio(const task_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);