Magellan Linux

Annotation of /trunk/kernel26-alx/patches-2.6.17-r5/0004-2.6.17-sched-staircase16_interactive_tunable.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 199 - (hide annotations) (download)
Fri May 18 11:04:36 2007 UTC (17 years ago) by niro
File size: 4299 byte(s)
-import

1 niro 199 Add the interactive tunable for the staircase cpu scheduler. The default
2     behaviour is for nice value to determine cpu proportion only, and wakeup
3     latency is determined by the percentage of the cpu entitlement of a task. The
4     interactive tunable modifies this behaviour such that nice value determines
5     both cpu proportion and wakeup latency.
6    
7     Signed-off-by: Con Kolivas <kernel@kolivas.org>
8    
9     Documentation/sysctl/kernel.txt | 10 ++++++++++
10     include/linux/sched.h | 1 +
11     include/linux/sysctl.h | 1 +
12     kernel/sched.c | 8 +++++++-
13     kernel/sysctl.c | 8 ++++++++
14     5 files changed, 27 insertions(+), 1 deletion(-)
15    
16     Index: linux-ck-dev/include/linux/sched.h
17     ===================================================================
18     --- linux-ck-dev.orig/include/linux/sched.h 2006-06-18 15:23:05.000000000 +1000
19     +++ linux-ck-dev/include/linux/sched.h 2006-06-18 15:23:07.000000000 +1000
20     @@ -202,6 +202,7 @@ extern void show_stack(struct task_struc
21    
22     void io_schedule(void);
23     long io_schedule_timeout(long timeout);
24     +extern int sched_interactive;
25    
26     extern void cpu_init (void);
27     extern void trap_init(void);
28     Index: linux-ck-dev/include/linux/sysctl.h
29     ===================================================================
30     --- linux-ck-dev.orig/include/linux/sysctl.h 2006-06-18 15:23:05.000000000 +1000
31     +++ linux-ck-dev/include/linux/sysctl.h 2006-06-18 15:23:07.000000000 +1000
32     @@ -148,6 +148,7 @@ enum
33     KERN_SPIN_RETRY=70, /* int: number of spinlock retries */
34     KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */
35     KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */
36     + KERN_INTERACTIVE=73, /* interactive tasks can have cpu bursts */
37     };
38    
39    
40     Index: linux-ck-dev/kernel/sysctl.c
41     ===================================================================
42     --- linux-ck-dev.orig/kernel/sysctl.c 2006-06-18 15:23:05.000000000 +1000
43     +++ linux-ck-dev/kernel/sysctl.c 2006-06-18 15:23:07.000000000 +1000
44     @@ -623,6 +623,14 @@ static ctl_table kern_table[] = {
45     .mode = 0444,
46     .proc_handler = &proc_dointvec,
47     },
48     + {
49     + .ctl_name = KERN_INTERACTIVE,
50     + .procname = "interactive",
51     + .data = &sched_interactive,
52     + .maxlen = sizeof (int),
53     + .mode = 0644,
54     + .proc_handler = &proc_dointvec,
55     + },
56     #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
57     {
58     .ctl_name = KERN_UNKNOWN_NMI_PANIC,
59     Index: linux-ck-dev/kernel/sched.c
60     ===================================================================
61     --- linux-ck-dev.orig/kernel/sched.c 2006-06-18 15:23:05.000000000 +1000
62     +++ linux-ck-dev/kernel/sched.c 2006-06-18 15:23:07.000000000 +1000
63     @@ -58,6 +58,12 @@
64     #include <asm/unistd.h>
65    
66     /*
67     + * sched_interactive - sysctl which allows interactive tasks to have bonus
68     + * raise its priority.
69     + */
70     +int sched_interactive __read_mostly = 1;
71     +
72     +/*
73     * Convert user-nice values [ -20 ... 0 ... 19 ]
74     * to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ],
75     * and back.
76     @@ -731,7 +737,7 @@ static int effective_prio(const task_t *
77    
78     best_bonus = bonus(p);
79     prio = MAX_RT_PRIO + best_bonus;
80     - if (!batch_task(p))
81     + if (sched_interactive && !batch_task(p))
82     prio -= p->bonus;
83    
84     rr = rr_interval(p);
85     Index: linux-ck-dev/Documentation/sysctl/kernel.txt
86     ===================================================================
87     --- linux-ck-dev.orig/Documentation/sysctl/kernel.txt 2006-06-18 15:23:05.000000000 +1000
88     +++ linux-ck-dev/Documentation/sysctl/kernel.txt 2006-06-18 15:23:07.000000000 +1000
89     @@ -25,6 +25,7 @@ show up in /proc/sys/kernel:
90     - domainname
91     - hostname
92     - hotplug
93     +- interactive
94     - java-appletviewer [ binfmt_java, obsolete ]
95     - java-interpreter [ binfmt_java, obsolete ]
96     - l2cr [ PPC only ]
97     @@ -161,6 +162,15 @@ Default value is "/sbin/hotplug".
98    
99     ==============================================================
100    
101     +interactive:
102     +
103     +This flag controls the allocation of dynamic priorities in the cpu
104     +scheduler. It gives low cpu using tasks high priority for lowest
105     +latencies. Nice value is still observed but stricter cpu proportions
106     +are obeyed if this tunable is disabled. Enabled by default.
107     +
108     +==============================================================
109     +
110     l2cr: (PPC only)
111    
112     This flag controls the L2 cache of G3 processor boards. If