diff -urNp --exclude CVS --exclude BitKeeper x-ref/include/linux/sysctl.h x/include/linux/sysctl.h --- x-ref/include/linux/sysctl.h 2003-07-17 11:21:28.000000000 +0200 +++ x/include/linux/sysctl.h 2003-07-17 11:21:59.000000000 +0200 @@ -132,6 +132,7 @@ enum KERN_SHMBIGPAGESPERFILE=59, /* int: max bigpages per file */ KERN_MAXTIMESLICE=60, /* int: nice -20 max timeslice */ KERN_MINTIMESLICE=61, /* int: nice +19 min timeslice */ + KERN_SCHED_YIELD_SCALE=62, /* int: select between scalable or interactive */ }; diff -urNp --exclude CVS --exclude BitKeeper x-ref/kernel/sched.c x/kernel/sched.c --- x-ref/kernel/sched.c 2003-07-17 11:21:28.000000000 +0200 +++ x/kernel/sched.c 2003-07-17 11:21:29.000000000 +0200 @@ -1484,6 +1484,8 @@ out_unlock: return retval; } +int sysctl_sched_yield_scale = 1; + asmlinkage long sys_sched_yield(void) { runqueue_t *rq = this_rq(); @@ -1511,6 +1513,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 x-ref/kernel/sysctl.c x/kernel/sysctl.c --- x-ref/kernel/sysctl.c 2003-07-17 11:21:28.000000000 +0200 +++ x/kernel/sysctl.c 2003-07-17 11:22:19.000000000 +0200 @@ -54,6 +54,7 @@ extern int sysrq_enabled; extern int core_uses_pid; 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; @@ -288,6 +289,8 @@ static ctl_table kern_table[] = { &MAX_TIMESLICE,sizeof(int),0644,NULL,&proc_dointvec}, {KERN_MINTIMESLICE, "min-timeslice", &MIN_TIMESLICE,sizeof(int),0644,NULL,&proc_dointvec}, + {KERN_SCHED_YIELD_SCALE, "sched_yield_scale", + &sysctl_sched_yield_scale, sizeof(int), 0644, NULL, &proc_dointvec}, {0} };