summary refs log tree commit diff
path: root/kernel/sched
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-03-10 12:54:09 +0100
committerThomas Gleixner <tglx@linutronix.de>2016-05-06 14:58:23 +0200
commit9cf7243d5d83d27aca47f842107bfa02b5f11d16 (patch)
tree7d799da897639ca17556e4c67d707f6b060a4320 /kernel/sched
parente9d867a67fd03ccc07248ca4e9c2f74fed494d5b (diff)
downloadlinux-9cf7243d5d83d27aca47f842107bfa02b5f11d16.tar.gz
sched: Make set_cpu_rq_start_time() a built in hotplug state
Start distangling the maze of hotplug notifiers in the scheduler.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: rt@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/core.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 8bfd7d4f1c21..4df9aaae27a2 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5473,10 +5473,10 @@ static struct notifier_block migration_notifier = {
 	.priority = CPU_PRI_MIGRATION,
 };
 
-static void set_cpu_rq_start_time(void)
+static void set_cpu_rq_start_time(unsigned int cpu)
 {
-	int cpu = smp_processor_id();
 	struct rq *rq = cpu_rq(cpu);
+
 	rq->age_stamp = sched_clock_cpu(cpu);
 }
 
@@ -5486,10 +5486,6 @@ static int sched_cpu_active(struct notifier_block *nfb,
 	int cpu = (long)hcpu;
 
 	switch (action & ~CPU_TASKS_FROZEN) {
-	case CPU_STARTING:
-		set_cpu_rq_start_time();
-		return NOTIFY_OK;
-
 	case CPU_DOWN_FAILED:
 		set_cpu_active(cpu, true);
 		return NOTIFY_OK;
@@ -5511,6 +5507,12 @@ static int sched_cpu_inactive(struct notifier_block *nfb,
 	}
 }
 
+int sched_cpu_starting(unsigned int cpu)
+{
+	set_cpu_rq_start_time(cpu);
+	return 0;
+}
+
 static int __init migration_init(void)
 {
 	void *cpu = (void *)(long)smp_processor_id();
@@ -7426,7 +7428,7 @@ void __init sched_init(void)
 	if (cpu_isolated_map == NULL)
 		zalloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT);
 	idle_thread_set_boot_cpu();
-	set_cpu_rq_start_time();
+	set_cpu_rq_start_time(smp_processor_id());
 #endif
 	init_sched_fair_class();