Magellan Linux

Contents of /trunk/kernel26-magellan/patches-2.6.21-r13/0002-2.6.21-sched-sd-0.48-interactive_tunable.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 319 - (show annotations) (download)
Sun Aug 19 18:14:21 2007 UTC (17 years, 2 months ago) by niro
File size: 4860 byte(s)
-2.6.21-magellan-r13

1 Add "interactive" tunable and enable by default.
2
3 The staircase-deadline cpu scheduler can be set in either purely
4 forward-looking mode for absolutely rigid fairness and cpu distribution
5 according to nice level, or it can allow a small per-process history
6 to smooth out cpu usage perturbations common in interactive tasks by
7 enabling this sysctl. While small fairness issues can arise with this
8 enabled, overall fairness is usually still strongly maintained and
9 starvation is never possible. Enabling this can significantly smooth
10 out 3d graphics and games.
11
12 Signed-off-by: Con Kolivas <kernel@kolivas.org>
13
14 ---
15 Documentation/sysctl/kernel.txt | 16 ++++++++++++++++
16 kernel/sched.c | 17 +++++++++++++++--
17 kernel/sysctl.c | 9 +++++++++
18 3 files changed, 40 insertions(+), 2 deletions(-)
19
20 Index: linux-2.6.21-ck2/kernel/sched.c
21 ===================================================================
22 --- linux-2.6.21-ck2.orig/kernel/sched.c 2007-05-14 19:30:30.000000000 +1000
23 +++ linux-2.6.21-ck2/kernel/sched.c 2007-05-14 19:30:30.000000000 +1000
24 @@ -101,6 +101,7 @@ unsigned long long __attribute__((weak))
25 * Tunable via /proc interface.
26 */
27 int rr_interval __read_mostly = 8;
28 +int sched_interactive __read_mostly = 1;
29
30 /*
31 * This contains a bitmap for each dynamic priority level with empty slots
32 @@ -687,6 +688,18 @@ static int first_prio_slot(struct task_s
33 }
34
35 /*
36 + * In sched_interactive mode priority allocation occurs per process per rq
37 + * array swap. In !sched_interactive mode all waking tasks must obey the
38 + * current prio level of all other tasks running per array swap.
39 + */
40 +static int minprio(struct rq *rq, int uprio)
41 +{
42 + if (sched_interactive)
43 + return MAX_RT_PRIO;
44 + return rq->prio_level[uprio];
45 +}
46 +
47 +/*
48 * Find the first unused slot by this task that is also in its prio_matrix
49 * level. SCHED_BATCH tasks do not use the priority matrix. They only take
50 * priority slots from their static_prio and above.
51 @@ -714,11 +727,11 @@ static int next_entitled_slot(struct tas
52 if (likely(p->policy != SCHED_BATCH))
53 array->best_static_prio = p->static_prio;
54 } else if (p->static_prio == array->best_static_prio) {
55 - search_prio = rq->prio_level[uprio];
56 + search_prio = minprio(rq, uprio);
57 } else {
58 int i;
59
60 - search_prio = rq->prio_level[uprio];
61 + search_prio = minprio(rq, uprio);
62 /* A bound O(n) function, worst case n is 40 */
63 for (i = array->best_static_prio; i <= p->static_prio ; i++) {
64 if (!rq->prio_level[USER_PRIO(i)])
65 Index: linux-2.6.21-ck2/kernel/sysctl.c
66 ===================================================================
67 --- linux-2.6.21-ck2.orig/kernel/sysctl.c 2007-05-14 19:30:30.000000000 +1000
68 +++ linux-2.6.21-ck2/kernel/sysctl.c 2007-05-14 19:30:30.000000000 +1000
69 @@ -77,6 +77,7 @@ extern int sysctl_drop_caches;
70 extern int percpu_pagelist_fraction;
71 extern int compat_log;
72 extern int rr_interval;
73 +extern int sched_interactive;
74
75 /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
76 static int maxolduid = 65535;
77 @@ -519,6 +520,14 @@ static ctl_table kern_table[] = {
78 .extra1 = &one,
79 .extra2 = &five_thousand,
80 },
81 + {
82 + .ctl_name = CTL_UNNUMBERED,
83 + .procname = "interactive",
84 + .data = &sched_interactive,
85 + .maxlen = sizeof(int),
86 + .mode = 0644,
87 + .proc_handler = &proc_dointvec,
88 + },
89 #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
90 {
91 .ctl_name = KERN_UNKNOWN_NMI_PANIC,
92 Index: linux-2.6.21-ck2/Documentation/sysctl/kernel.txt
93 ===================================================================
94 --- linux-2.6.21-ck2.orig/Documentation/sysctl/kernel.txt 2007-05-14 19:30:30.000000000 +1000
95 +++ linux-2.6.21-ck2/Documentation/sysctl/kernel.txt 2007-05-14 19:30:30.000000000 +1000
96 @@ -25,6 +25,7 @@ show up in /proc/sys/kernel:
97 - domainname
98 - hostname
99 - hotplug
100 +- interactive
101 - java-appletviewer [ binfmt_java, obsolete ]
102 - java-interpreter [ binfmt_java, obsolete ]
103 - kstack_depth_to_print [ X86 only ]
104 @@ -165,6 +166,21 @@ Default value is "/sbin/hotplug".
105
106 ==============================================================
107
108 +interactive:
109 +
110 +The staircase-deadline cpu scheduler can be set in either purely
111 +forward-looking mode for absolutely rigid fairness and cpu distribution
112 +according to nice level, or it can allow a small per-process history
113 +to smooth out cpu usage perturbations common in interactive tasks by
114 +enabling this sysctl. While small fairness issues can arise with this
115 +enabled, overall fairness is usually still strongly maintained and
116 +starvation is never possible. Enabling this can significantly smooth
117 +out 3d graphics and games.
118 +
119 +Default value is 1 (enabled).
120 +
121 +==============================================================
122 +
123 l2cr: (PPC only)
124
125 This flag controls the L2 cache of G3 processor boards. If