Skip to contentSkip to conversation

sched-staircase16_interactive_tunable

PATCH In review Con Kolivas 1 participant 1 message Jun 18, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 4/29 sched-staircase16_interactive_tunable

Add the interactive tunable for the staircase cpu scheduler. The default behaviour is for nice value to determine cpu proportion only, and wakeup latency is determined by the percentage of the cpu entitlement of a task. The interactive tunable modifies this behaviour such that nice value determines both cpu proportion and wakeup latency.

 Documentation/sysctl/kernel.txt |   10 ++++++++++
 include/linux/sched.h           |    1 +
 include/linux/sysctl.h          |    1 +
 kernel/sched.c                  |    8 +++++++-
 kernel/sysctl.c                 |    8 ++++++++
 5 files changed, 27 insertions(+), 1 deletion(-)
include/linux/sched.h +1 -0
Index: linux-ck-dev/include/linux/sched.h
===================================================================
@@ -202,6 +202,7 @@ extern void show_stack(struct task_struc
 
 void io_schedule(void);
 long io_schedule_timeout(long timeout);
+extern int sched_interactive;
 
 extern void cpu_init (void);
 extern void trap_init(void);
include/linux/sysctl.h +1 -0
Index: linux-ck-dev/include/linux/sysctl.h
===================================================================
@@ -148,6 +148,7 @@ enum
 	KERN_SPIN_RETRY=70,	/* int: number of spinlock retries */
 	KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */
 	KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */
+	KERN_INTERACTIVE=73,	/* interactive tasks can have cpu bursts */
 };
 
 
kernel/sysctl.c +8 -0
Index: linux-ck-dev/kernel/sysctl.c
===================================================================
@@ -623,6 +623,14 @@ static ctl_table kern_table[] = {
 		.mode		= 0444,
 		.proc_handler	= &proc_dointvec,
 	},
+	{
+		.ctl_name	= KERN_INTERACTIVE,
+		.procname	= "interactive",
+		.data		= &sched_interactive,
+		.maxlen		= sizeof (int),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec,
+	},
 #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
 	{
 		.ctl_name       = KERN_UNKNOWN_NMI_PANIC,
kernel/sched.c +7 -1
Index: linux-ck-dev/kernel/sched.c
===================================================================
@@ -58,6 +58,12 @@
 #include <asm/unistd.h>
 
 /*
+ * sched_interactive - sysctl which allows interactive tasks to have bonus
+ * raise its priority.
+ */
+int sched_interactive __read_mostly = 1;
+
+/*
  * Convert user-nice values [ -20 ... 0 ... 19 ]
  * to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ],
  * and back.
@@ -731,7 +737,7 @@ static int effective_prio(const task_t *
 
 	best_bonus = bonus(p);
 	prio = MAX_RT_PRIO + best_bonus;
-	if (!batch_task(p))
+	if (sched_interactive && !batch_task(p))
 		prio -= p->bonus;
 
 	rr = rr_interval(p);
Documentation/sysctl/kernel.txt +10 -0
Index: linux-ck-dev/Documentation/sysctl/kernel.txt
===================================================================
@@ -25,6 +25,7 @@ show up in /proc/sys/kernel:
 - domainname
 - hostname
 - hotplug
+- interactive
 - java-appletviewer           [ binfmt_java, obsolete ]
 - java-interpreter            [ binfmt_java, obsolete ]
 - l2cr                        [ PPC only ]
@@ -161,6 +162,15 @@ Default value is "/sbin/hotplug".
 
 ==============================================================
 
+interactive:
+
+This flag controls the allocation of dynamic priorities in the cpu
+scheduler. It gives low cpu using tasks high priority for lowest
+latencies. Nice value is still observed but stricter cpu proportions
+are obeyed if this tunable is disabled. Enabled by default.
+
+==============================================================
+
 l2cr: (PPC only)
 
 This flag controls the L2 cache of G3 processor boards. If
Signature · 1 line
-ck