diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids x-ref/include/linux/sched.h x/include/linux/sched.h --- x-ref/include/linux/sched.h 2003-10-01 04:57:45.000000000 +0200 +++ x/include/linux/sched.h 2003-10-01 04:57:47.000000000 +0200 @@ -622,6 +622,8 @@ extern unsigned int * prof_buffer; extern unsigned long prof_len; extern unsigned long prof_shift; +extern int max_timeslice, min_timeslice; + #define CURRENT_TIME (xtime.tv_sec) extern void FASTCALL(__wake_up(wait_queue_head_t *q, unsigned int mode, int nr)); 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:57:45.000000000 +0200 +++ x/include/linux/sysctl.h 2003-10-01 05:00:19.000000000 +0200 @@ -132,6 +132,8 @@ enum 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 */ + KERN_MAXTIMESLICE=62, /* int: nice -20 max timeslice */ + KERN_MINTIMESLICE=63, /* int: nice +19 min timeslice */ }; 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:57:45.000000000 +0200 +++ x/kernel/sched.c 2003-10-01 04:59:36.000000000 +0200 @@ -52,8 +52,15 @@ * maximum timeslice is 300 msecs. Timeslices get refilled after * they expire. */ -#define MIN_TIMESLICE ( 10 * HZ / 1000) -#define MAX_TIMESLICE (300 * HZ / 1000) +#define __MIN_TIMESLICE 10000 +#define __MAX_TIMESLICE 310000 +#define __MIN_TIMESLICE_DESKTOP 1000 +#define __MAX_TIMESLICE_DESKTOP 31000 +/* the sysctl values are exported in usec units to userspace */ +int max_timeslice = __MAX_TIMESLICE, min_timeslice = __MIN_TIMESLICE; +#define MAX_TIMESLICE ((max_timeslice * HZ + 999999) / 1000000) +#define MIN_TIMESLICE ((min_timeslice * HZ + 999999) / 1000000) + #define CHILD_INHERITANCE 60 #define PRIO_BONUS_RATIO 25 #define INTERACTIVE_DELTA 2 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:57:45.000000000 +0200 +++ x/kernel/sysctl.c 2003-10-01 04:57:47.000000000 +0200 @@ -292,6 +292,10 @@ static ctl_table kern_table[] = { #endif {KERN_SCHED_YIELD_SCALE, "sched_yield_scale", &sysctl_sched_yield_scale, sizeof(int), 0644, NULL, &proc_dointvec}, + {KERN_MAXTIMESLICE, "max-timeslice", + &max_timeslice,sizeof(int),0644,NULL,&proc_dointvec}, + {KERN_MINTIMESLICE, "min-timeslice", + &min_timeslice,sizeof(int),0644,NULL,&proc_dointvec}, {0} };