diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index f46540b359c0..7c9098d186e6 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -7046,7 +7046,7 @@ static int migration_thread(void *data) | |||
7046 | 7046 | ||
7047 | if (cpu_is_offline(cpu)) { | 7047 | if (cpu_is_offline(cpu)) { |
7048 | spin_unlock_irq(&rq->lock); | 7048 | spin_unlock_irq(&rq->lock); |
7049 | goto wait_to_die; | 7049 | break; |
7050 | } | 7050 | } |
7051 | 7051 | ||
7052 | if (rq->active_balance) { | 7052 | if (rq->active_balance) { |
@@ -7072,16 +7072,7 @@ static int migration_thread(void *data) | |||
7072 | complete(&req->done); | 7072 | complete(&req->done); |
7073 | } | 7073 | } |
7074 | __set_current_state(TASK_RUNNING); | 7074 | __set_current_state(TASK_RUNNING); |
7075 | return 0; | ||
7076 | 7075 | ||
7077 | wait_to_die: | ||
7078 | /* Wait for kthread_stop */ | ||
7079 | set_current_state(TASK_INTERRUPTIBLE); | ||
7080 | while (!kthread_should_stop()) { | ||
7081 | schedule(); | ||
7082 | set_current_state(TASK_INTERRUPTIBLE); | ||
7083 | } | ||
7084 | __set_current_state(TASK_RUNNING); | ||
7085 | return 0; | 7076 | return 0; |
7086 | } | 7077 | } |
7087 | 7078 | ||
@@ -7495,6 +7486,7 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu) | |||
7495 | rq = task_rq_lock(p, &flags); | 7486 | rq = task_rq_lock(p, &flags); |
7496 | __setscheduler(rq, p, SCHED_FIFO, MAX_RT_PRIO-1); | 7487 | __setscheduler(rq, p, SCHED_FIFO, MAX_RT_PRIO-1); |
7497 | task_rq_unlock(rq, &flags); | 7488 | task_rq_unlock(rq, &flags); |
7489 | get_task_struct(p); | ||
7498 | cpu_rq(cpu)->migration_thread = p; | 7490 | cpu_rq(cpu)->migration_thread = p; |
7499 | break; | 7491 | break; |
7500 | 7492 | ||
@@ -7525,6 +7517,7 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu) | |||
7525 | kthread_bind(cpu_rq(cpu)->migration_thread, | 7517 | kthread_bind(cpu_rq(cpu)->migration_thread, |
7526 | cpumask_any(cpu_online_mask)); | 7518 | cpumask_any(cpu_online_mask)); |
7527 | kthread_stop(cpu_rq(cpu)->migration_thread); | 7519 | kthread_stop(cpu_rq(cpu)->migration_thread); |
7520 | put_task_struct(cpu_rq(cpu)->migration_thread); | ||
7528 | cpu_rq(cpu)->migration_thread = NULL; | 7521 | cpu_rq(cpu)->migration_thread = NULL; |
7529 | break; | 7522 | break; |
7530 | 7523 | ||
@@ -7534,6 +7527,7 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu) | |||
7534 | migrate_live_tasks(cpu); | 7527 | migrate_live_tasks(cpu); |
7535 | rq = cpu_rq(cpu); | 7528 | rq = cpu_rq(cpu); |
7536 | kthread_stop(rq->migration_thread); | 7529 | kthread_stop(rq->migration_thread); |
7530 | put_task_struct(rq->migration_thread); | ||
7537 | rq->migration_thread = NULL; | 7531 | rq->migration_thread = NULL; |
7538 | /* Idle task back to normal (off runqueue, low prio) */ | 7532 | /* Idle task back to normal (off runqueue, low prio) */ |
7539 | spin_lock_irq(&rq->lock); | 7533 | spin_lock_irq(&rq->lock); |
@@ -7829,7 +7823,7 @@ static void rq_attach_root(struct rq *rq, struct root_domain *rd) | |||
7829 | free_rootdomain(old_rd); | 7823 | free_rootdomain(old_rd); |
7830 | } | 7824 | } |
7831 | 7825 | ||
7832 | static int __init_refok init_rootdomain(struct root_domain *rd, bool bootmem) | 7826 | static int init_rootdomain(struct root_domain *rd, bool bootmem) |
7833 | { | 7827 | { |
7834 | gfp_t gfp = GFP_KERNEL; | 7828 | gfp_t gfp = GFP_KERNEL; |
7835 | 7829 | ||