diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/linux/sysctl.h x/include/linux/sysctl.h --- x-ref/include/linux/sysctl.h 2003-10-01 04:27:27.000000000 +0200 +++ x/include/linux/sysctl.h 2003-10-01 04:33:45.000000000 +0200 @@ -131,6 +131,7 @@ enum KERN_EXCEPTION_TRACE=58, /* boolean: exception trace */ KERN_CORE_SETUID=59, /* int: set to allow core dumps of setuid apps */ KERN_SHMBIGPAGESPERFILE=60, /* int: max bigpages per file */ + KERN_SCHED_YIELD_SCALE=61, /* int: select between scalable or interactive */ }; diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/kernel/sched.c x/kernel/sched.c --- x-ref/kernel/sched.c 2003-10-01 04:27:27.000000000 +0200 +++ x/kernel/sched.c 2003-10-01 04:27:29.000000000 +0200 @@ -1478,6 +1478,8 @@ out_unlock: return retval; } +int sysctl_sched_yield_scale = 1; + asmlinkage long sys_sched_yield(void) { runqueue_t *rq = this_rq(); @@ -1505,6 +1507,12 @@ asmlinkage long sys_sched_yield(void) if (unlikely(array == rq->expired) && rq->active->nr_active) goto out_unlock; + if (sysctl_sched_yield_scale) { + dequeue_task(current, array); + enqueue_task(current, rq->expired); + goto out_unlock; + } + list_del(¤t->run_list); if (!list_empty(array->queue + current->prio)) { list_add(¤t->run_list, array->queue[current->prio].next); diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/kernel/sysctl.c x/kernel/sysctl.c --- x-ref/kernel/sysctl.c 2003-10-01 04:27:27.000000000 +0200 +++ x/kernel/sysctl.c 2003-10-01 04:34:14.000000000 +0200 @@ -55,6 +55,7 @@ extern int core_uses_pid; extern int core_setuid_ok; extern char core_pattern[]; extern int cad_pid; +extern int sysctl_sched_yield_scale; /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */ static int maxolduid = 65535; @@ -287,6 +288,8 @@ static ctl_table kern_table[] = { {KERN_EXCEPTION_TRACE,"exception-trace", &exception_trace,sizeof(int),0644,NULL,&proc_dointvec}, #endif + {KERN_SCHED_YIELD_SCALE, "sched_yield_scale", + &sysctl_sched_yield_scale, sizeof(int), 0644, NULL, &proc_dointvec}, {0} };