Skip to contentSkip to conversation

Make new sched_domains sysctls private

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

lore
Share & tools
lore
#0 lore raw

PATCH 28/28 Make new sched_domains sysctls private

Make new sched_domains sysctls private

Privatise the domain sysctl functions as they refer to runqueue structures which may differ between schedulers.

include/linux/scheduler.h +2 -0
Index: linux-2.6.10-rc1-mm2-plugsched1/include/linux/scheduler.h
===================================================================
@@ -10,6 +10,8 @@
  */
 struct sched_drv
 {
+	void (*init_sched_domain_sysctl)(void);
+	void (*destroy_sched_domain_sysctl)(void);
 	void (*account_steal_time)(struct task_struct *, cputime_t);
 	void (*account_system_time)(struct task_struct *, int, cputime_t);
 	void (*account_user_time)(struct task_struct *, cputime_t);
kernel/sched.c +6 -4
Index: linux-2.6.10-rc1-mm2-plugsched1/kernel/sched.c
===================================================================
@@ -4036,7 +4036,7 @@ static ctl_table *sd_alloc_ctl_cpu_table
 }
 
 static struct ctl_table_header *sd_sysctl_header;
-void init_sched_domain_sysctl()
+void ingo_init_sched_domain_sysctl(void)
 {
 	int i, cpu_num = num_online_cpus();
 	char buf[32];
@@ -4054,7 +4054,7 @@ void init_sched_domain_sysctl()
 	sd_sysctl_header = register_sysctl_table(sd_ctl_root, 0);
 }
 
-void destroy_sched_domain_sysctl()
+static void ingo_destroy_sched_domain_sysctl(void)
 {
 	int cpu, cpu_num = num_online_cpus();
 	struct sched_domain *sd;
@@ -4076,15 +4076,17 @@ void destroy_sched_domain_sysctl()
 	kfree(root);
 }
 #else
-void init_sched_domain_sysctl()
+static void ingo_init_sched_domain_sysctl()
 {
 }
-void destroy_sched_domain_sysctl()
+static void ingo_destroy_sched_domain_sysctl()
 {
 }
 #endif
 
 struct sched_drv ingo_sched_drv = {
+	.init_sched_domain_sysctl = ingo_init_sched_domain_sysctl,
+	.destroy_sched_domain_sysctl = ingo_destroy_sched_domain_sysctl,
 	.account_steal_time	= ingo_account_steal_time,
 	.account_system_time	= ingo_account_system_time,
 	.account_user_time	= ingo_account_user_time,
kernel/scheduler.c +10 -0
Index: linux-2.6.10-rc1-mm2-plugsched1/kernel/scheduler.c
===================================================================
@@ -993,6 +993,16 @@ static int __init scheduler_setup(char *
 
 __setup ("cpusched=", scheduler_setup);
 
+void init_sched_domain_sysctl(void)
+{
+	scheduler->init_sched_domain_sysctl();
+}
+
+void destroy_sched_domain_sysctl(void)
+{
+	scheduler->destroy_sched_domain_sysctl();
+}
+
 void account_steal_time(struct task_struct *p, cputime_t steal)
 {
 	scheduler->account_steal_time(p, steal);