diff -urN oldtree/Documentation/sysctl/kernel.txt newtree/Documentation/sysctl/kernel.txt --- oldtree/Documentation/sysctl/kernel.txt 2006-08-19 08:50:23.000000000 -0400 +++ newtree/Documentation/sysctl/kernel.txt 2006-08-19 08:56:02.000000000 -0400 @@ -27,6 +27,7 @@ - hostname - hotplug - interactive +- iso_cpu - java-appletviewer [ binfmt_java, obsolete ] - java-interpreter [ binfmt_java, obsolete ] - l2cr [ PPC only ] @@ -182,6 +183,14 @@ ============================================================== +iso_cpu: + +This sets the percentage cpu that the unprivileged SCHED_ISO tasks can +run effectively at realtime priority, averaged over a rolling 3 seconds. +Set to 80% by default. + +============================================================== + l2cr: (PPC only) This flag controls the L2 cache of G3 processor boards. If diff -urN oldtree/include/linux/sched.h newtree/include/linux/sched.h --- oldtree/include/linux/sched.h 2006-08-19 08:50:23.000000000 -0400 +++ newtree/include/linux/sched.h 2006-08-19 08:53:23.000000000 -0400 @@ -34,10 +34,11 @@ #define SCHED_FIFO 1 #define SCHED_RR 2 #define SCHED_BATCH 3 +#define SCHED_ISO 4 #ifdef __KERNEL__ -#define SCHED_MAX SCHED_BATCH +#define SCHED_MAX SCHED_ISO #define SCHED_RANGE(policy) ((policy) <= SCHED_MAX) #define SCHED_RT(policy) ((policy) == SCHED_FIFO || \ (policy) == SCHED_RR) @@ -213,7 +214,7 @@ void io_schedule(void); long io_schedule_timeout(long timeout); #ifdef CONFIG_STAIRCASE -extern int sched_interactive, sched_compute; +extern int sched_interactive, sched_compute, sched_iso_cpu; #endif extern void cpu_init (void); @@ -509,6 +510,7 @@ #define MAX_USER_RT_PRIO 100 #define MAX_RT_PRIO MAX_USER_RT_PRIO +#define ISO_PRIO (MAX_RT_PRIO - 1) #define MAX_PRIO (MAX_RT_PRIO + 40) @@ -516,6 +518,7 @@ #define rt_task(p) rt_prio((p)->prio) #define batch_task(p) (unlikely((p)->policy == SCHED_BATCH)) #define has_rt_policy(p) unlikely(SCHED_RT((p)->policy)) +#define iso_task(p) (unlikely((p)->policy == SCHED_ISO)) /* Must be high prio: stop_machine expects to yield to it. */ #define MIGRATION_THREAD_PRIO (MAX_RT_PRIO-20) @@ -1110,6 +1113,7 @@ #define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */ #define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ #define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */ +#define PF_ISOREF 0x04000000 /* SCHED_ISO task has used up quota */ #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ diff -urN oldtree/include/linux/sysctl.h newtree/include/linux/sysctl.h --- oldtree/include/linux/sysctl.h 2006-08-19 08:50:23.000000000 -0400 +++ newtree/include/linux/sysctl.h 2006-08-19 08:54:13.000000000 -0400 @@ -155,6 +155,7 @@ KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */ KERN_INTERACTIVE=77, /* interactive tasks can have cpu bursts */ KERN_COMPUTE=78, /* adjust timeslices for a compute server */ + KERN_ISO_CPU=79, /* percent cpu SCHED_ISO tasks run SCHED_RR */ }; diff -urN oldtree/kernel/sysctl.c newtree/kernel/sysctl.c --- oldtree/kernel/sysctl.c 2006-08-19 08:50:23.000000000 -0400 +++ newtree/kernel/sysctl.c 2006-08-19 08:55:28.000000000 -0400 @@ -234,6 +234,11 @@ { .ctl_name = 0 } }; +/* Constants for minimum and maximum testing. + We use these as one-element integer vectors. */ +static int zero; +static int one_hundred = 100; + static ctl_table kern_table[] = { #ifndef CONFIG_UTS_NS { @@ -702,6 +707,17 @@ .mode = 0644, .proc_handler = &proc_dointvec, }, + { + .ctl_name = KERN_ISO_CPU, + .procname = "iso_cpu", + .data = &sched_iso_cpu, + .maxlen = sizeof (int), + .mode = 0644, + .proc_handler = &proc_dointvec_minmax, + .strategy = &sysctl_intvec, + .extra1 = &zero, + .extra2 = &one_hundred, + }, #endif #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) { @@ -803,12 +819,6 @@ { .ctl_name = 0 } }; -/* Constants for minimum and maximum testing in vm_table. - We use these as one-element integer vectors. */ -static int zero; -static int one_hundred = 100; - - static ctl_table vm_table[] = { { .ctl_name = VM_OVERCOMMIT_MEMORY,