diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2016-03-10 06:54:15 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-05-06 08:58:24 -0400 |
commit | 94baf7a5d882cde0b4d591f4ab89cc32ee39ac6a (patch) | |
tree | 06111a2e968549af69e871b1f4afbb221c33fc8e /kernel/sched | |
parent | b2454caa8977ade27292a71f2def5e403e24b4d5 (diff) |
sched/migration: Move prepare transition to SCHED_STARTING state
We can piggy pack that on the SCHED_STARTING state. It's not required before
the cpu actually comes online. Name the function proper as it has nothing to
do with migration.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160310120025.248226511@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/core.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 0a3107809972..bafc308e6d45 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -5424,11 +5424,6 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu) | |||
5424 | 5424 | ||
5425 | switch (action & ~CPU_TASKS_FROZEN) { | 5425 | switch (action & ~CPU_TASKS_FROZEN) { |
5426 | 5426 | ||
5427 | case CPU_UP_PREPARE: | ||
5428 | rq->calc_load_update = calc_load_update; | ||
5429 | account_reset_rq(rq); | ||
5430 | break; | ||
5431 | |||
5432 | case CPU_ONLINE: | 5427 | case CPU_ONLINE: |
5433 | /* Update our root-domain */ | 5428 | /* Update our root-domain */ |
5434 | raw_spin_lock_irqsave(&rq->lock, flags); | 5429 | raw_spin_lock_irqsave(&rq->lock, flags); |
@@ -7139,9 +7134,19 @@ int sched_cpu_deactivate(unsigned int cpu) | |||
7139 | return 0; | 7134 | return 0; |
7140 | } | 7135 | } |
7141 | 7136 | ||
7137 | static void sched_rq_cpu_starting(unsigned int cpu) | ||
7138 | { | ||
7139 | struct rq *rq = cpu_rq(cpu); | ||
7140 | |||
7141 | rq->calc_load_update = calc_load_update; | ||
7142 | account_reset_rq(rq); | ||
7143 | update_max_interval(); | ||
7144 | } | ||
7145 | |||
7142 | int sched_cpu_starting(unsigned int cpu) | 7146 | int sched_cpu_starting(unsigned int cpu) |
7143 | { | 7147 | { |
7144 | set_cpu_rq_start_time(cpu); | 7148 | set_cpu_rq_start_time(cpu); |
7149 | sched_rq_cpu_starting(cpu); | ||
7145 | return 0; | 7150 | return 0; |
7146 | } | 7151 | } |
7147 | 7152 | ||
@@ -7182,11 +7187,8 @@ void __init sched_init_smp(void) | |||
7182 | static int __init migration_init(void) | 7187 | static int __init migration_init(void) |
7183 | { | 7188 | { |
7184 | void *cpu = (void *)(long)smp_processor_id(); | 7189 | void *cpu = (void *)(long)smp_processor_id(); |
7185 | int err; | ||
7186 | 7190 | ||
7187 | /* Initialize migration for the boot CPU */ | 7191 | sched_rq_cpu_starting(smp_processor_id()); |
7188 | err = migration_call(&migration_notifier, CPU_UP_PREPARE, cpu); | ||
7189 | BUG_ON(err == NOTIFY_BAD); | ||
7190 | migration_call(&migration_notifier, CPU_ONLINE, cpu); | 7192 | migration_call(&migration_notifier, CPU_ONLINE, cpu); |
7191 | register_cpu_notifier(&migration_notifier); | 7193 | register_cpu_notifier(&migration_notifier); |
7192 | 7194 | ||