--- 2.4.21pre4aa3/include/linux/sysctl.h.~1~ 2003-02-24 19:15:04.000000000 +0100 +++ 2.4.21pre4aa3/include/linux/sysctl.h 2003-03-01 04:32:55.000000000 +0100 @@ -127,6 +127,7 @@ enum KERN_CADPID=54, /* int: PID of the process to notify on CAD */ KERN_SHMUSEBIGPAGES=55, /* int: use bigpages wherever possible */ KERN_CORE_PATTERN=56, /* string: pattern for core-files */ + KERN_SCHED_YIELD_SCALE=57, /* int: select between scalable or interactive */ }; --- 2.4.21pre4aa3/kernel/sched.c.~1~ 2003-02-24 19:12:54.000000000 +0100 +++ 2.4.21pre4aa3/kernel/sched.c 2003-03-01 04:29:12.000000000 +0100 @@ -1471,6 +1471,8 @@ out_unlock: return retval; } +int sysctl_sched_yield_scale = 1; + asmlinkage long sys_sched_yield(void) { runqueue_t *rq = this_rq(); @@ -1498,6 +1500,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); --- 2.4.21pre4aa3/kernel/sysctl.c.~1~ 2003-02-24 19:12:54.000000000 +0100 +++ 2.4.21pre4aa3/kernel/sysctl.c 2003-03-01 04:31:47.000000000 +0100 @@ -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; @@ -272,6 +273,8 @@ static ctl_table kern_table[] = { {KERN_S390_USER_DEBUG_LOGGING,"userprocess_debug", &sysctl_userprocess_debug,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} };