diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2016-03-10 06:54:09 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-05-06 08:58:23 -0400 |
commit | 9cf7243d5d83d27aca47f842107bfa02b5f11d16 (patch) | |
tree | 7d799da897639ca17556e4c67d707f6b060a4320 /kernel/sched | |
parent | e9d867a67fd03ccc07248ca4e9c2f74fed494d5b (diff) |
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.c | 16 |
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 = { | |||
5473 | .priority = CPU_PRI_MIGRATION, | 5473 | .priority = CPU_PRI_MIGRATION, |
5474 | }; | 5474 | }; |
5475 | 5475 | ||
5476 | static void set_cpu_rq_start_time(void) | 5476 | static void set_cpu_rq_start_time(unsigned int cpu) |
5477 | { | 5477 | { |
5478 | int cpu = smp_processor_id(); | ||
5479 | struct rq *rq = cpu_rq(cpu); | 5478 | struct rq *rq = cpu_rq(cpu); |
5479 | |||
5480 | rq->age_stamp = sched_clock_cpu(cpu); | 5480 | rq->age_stamp = sched_clock_cpu(cpu); |
5481 | } | 5481 | } |
5482 | 5482 | ||
@@ -5486,10 +5486,6 @@ static int sched_cpu_active(struct notifier_block *nfb, | |||
5486 | int cpu = (long)hcpu; | 5486 | int cpu = (long)hcpu; |
5487 | 5487 | ||
5488 | switch (action & ~CPU_TASKS_FROZEN) { | 5488 | switch (action & ~CPU_TASKS_FROZEN) { |
5489 | case CPU_STARTING: | ||
5490 | set_cpu_rq_start_time(); | ||
5491 | return NOTIFY_OK; | ||
5492 | |||
5493 | case CPU_DOWN_FAILED: | 5489 | case CPU_DOWN_FAILED: |
5494 | set_cpu_active(cpu, true); | 5490 | set_cpu_active(cpu, true); |
5495 | return NOTIFY_OK; | 5491 | return NOTIFY_OK; |
@@ -5511,6 +5507,12 @@ static int sched_cpu_inactive(struct notifier_block *nfb, | |||
5511 | } | 5507 | } |
5512 | } | 5508 | } |
5513 | 5509 | ||
5510 | int sched_cpu_starting(unsigned int cpu) | ||
5511 | { | ||
5512 | set_cpu_rq_start_time(cpu); | ||
5513 | return 0; | ||
5514 | } | ||
5515 | |||
5514 | static int __init migration_init(void) | 5516 | static int __init migration_init(void) |
5515 | { | 5517 | { |
5516 | void *cpu = (void *)(long)smp_processor_id(); | 5518 | void *cpu = (void *)(long)smp_processor_id(); |
@@ -7426,7 +7428,7 @@ void __init sched_init(void) | |||
7426 | if (cpu_isolated_map == NULL) | 7428 | if (cpu_isolated_map == NULL) |
7427 | zalloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT); | 7429 | zalloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT); |
7428 | idle_thread_set_boot_cpu(); | 7430 | idle_thread_set_boot_cpu(); |
7429 | set_cpu_rq_start_time(); | 7431 | set_cpu_rq_start_time(smp_processor_id()); |
7430 | #endif | 7432 | #endif |
7431 | init_sched_fair_class(); | 7433 | init_sched_fair_class(); |
7432 | 7434 | ||