Skip to contentSkip to conversation

Name and choose scheduler

PATCH In review Con Kolivas 1 participant 1 message Oct 30, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 19/28 Name and choose scheduler

Name and choose scheduler

Add a scheduler name and the beginnings of bootparam checking to change scheduler at boot time.

include/linux/scheduler.h +3 -0
Index: linux-2.6.10-rc1-mm2-plugsched1/include/linux/scheduler.h
===================================================================
@@ -1,5 +1,8 @@
+#define SCHED_NAME_MAX	(16)
+
 struct sched_drv
 {
+	char cpusched_name[SCHED_NAME_MAX];
 	int (*rt_task)(task_t *);
 	void (*wait_for_completion)(struct completion *);
 	void (*io_schedule)(void);
kernel/sched.c +1 -0
Index: linux-2.6.10-rc1-mm2-plugsched1/kernel/sched.c
===================================================================
@@ -4151,6 +4151,7 @@ void destroy_sched_domain_sysctl()
 #endif
 
 struct sched_drv ingo_sched_drv = {
+	.cpusched_name		= "ingosched",
 	.rt_task		= ingo_rt_task,
 	.wait_for_completion	= ingo_wait_for_completion,
 	.io_schedule		= ingo_io_schedule,
kernel/scheduler.c +11 -1
Index: linux-2.6.10-rc1-mm2-plugsched1/kernel/scheduler.c
===================================================================
@@ -878,7 +878,17 @@ void fastcall complete_all(struct comple
 EXPORT_SYMBOL(complete_all);
 
 extern struct sched_drv ingo_sched_drv;
-static const struct sched_drv *scheduler = &ingo_sched_drv;
+
+static struct sched_drv *scheduler = &ingo_sched_drv;
+
+static int __init scheduler_setup(char *str)
+{
+	if (!strcmp(str, "ingosched"))
+		scheduler = &ingo_sched_drv;
+	return 1;
+}
+
+__setup ("cpusched=", scheduler_setup);
 
 void fastcall __sched wait_for_completion(struct completion *x)
 {