diff options
| -rw-r--r-- | kernel/sched/core.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 34e2291a9a6c..2d6e828a0471 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
| @@ -5557,7 +5557,7 @@ static void migrate_tasks(struct rq *dead_rq) | |||
| 5557 | { | 5557 | { |
| 5558 | struct rq *rq = dead_rq; | 5558 | struct rq *rq = dead_rq; |
| 5559 | struct task_struct *next, *stop = rq->stop; | 5559 | struct task_struct *next, *stop = rq->stop; |
| 5560 | struct rq_flags rf, old_rf; | 5560 | struct rq_flags rf; |
| 5561 | int dest_cpu; | 5561 | int dest_cpu; |
| 5562 | 5562 | ||
| 5563 | /* | 5563 | /* |
| @@ -5576,7 +5576,9 @@ static void migrate_tasks(struct rq *dead_rq) | |||
| 5576 | * class method both need to have an up-to-date | 5576 | * class method both need to have an up-to-date |
| 5577 | * value of rq->clock[_task] | 5577 | * value of rq->clock[_task] |
| 5578 | */ | 5578 | */ |
| 5579 | rq_pin_lock(rq, &rf); | ||
| 5579 | update_rq_clock(rq); | 5580 | update_rq_clock(rq); |
| 5581 | rq_unpin_lock(rq, &rf); | ||
| 5580 | 5582 | ||
| 5581 | for (;;) { | 5583 | for (;;) { |
| 5582 | /* | 5584 | /* |
| @@ -5589,7 +5591,7 @@ static void migrate_tasks(struct rq *dead_rq) | |||
| 5589 | /* | 5591 | /* |
| 5590 | * pick_next_task() assumes pinned rq->lock: | 5592 | * pick_next_task() assumes pinned rq->lock: |
| 5591 | */ | 5593 | */ |
| 5592 | rq_pin_lock(rq, &rf); | 5594 | rq_repin_lock(rq, &rf); |
| 5593 | next = pick_next_task(rq, &fake_task, &rf); | 5595 | next = pick_next_task(rq, &fake_task, &rf); |
| 5594 | BUG_ON(!next); | 5596 | BUG_ON(!next); |
| 5595 | next->sched_class->put_prev_task(rq, next); | 5597 | next->sched_class->put_prev_task(rq, next); |
| @@ -5618,13 +5620,6 @@ static void migrate_tasks(struct rq *dead_rq) | |||
| 5618 | continue; | 5620 | continue; |
| 5619 | } | 5621 | } |
| 5620 | 5622 | ||
| 5621 | /* | ||
| 5622 | * __migrate_task() may return with a different | ||
| 5623 | * rq->lock held and a new cookie in 'rf', but we need | ||
| 5624 | * to preserve rf::clock_update_flags for 'dead_rq'. | ||
| 5625 | */ | ||
| 5626 | old_rf = rf; | ||
| 5627 | |||
| 5628 | /* Find suitable destination for @next, with force if needed. */ | 5623 | /* Find suitable destination for @next, with force if needed. */ |
| 5629 | dest_cpu = select_fallback_rq(dead_rq->cpu, next); | 5624 | dest_cpu = select_fallback_rq(dead_rq->cpu, next); |
| 5630 | 5625 | ||
| @@ -5633,7 +5628,6 @@ static void migrate_tasks(struct rq *dead_rq) | |||
| 5633 | raw_spin_unlock(&rq->lock); | 5628 | raw_spin_unlock(&rq->lock); |
| 5634 | rq = dead_rq; | 5629 | rq = dead_rq; |
| 5635 | raw_spin_lock(&rq->lock); | 5630 | raw_spin_lock(&rq->lock); |
| 5636 | rf = old_rf; | ||
| 5637 | } | 5631 | } |
| 5638 | raw_spin_unlock(&next->pi_lock); | 5632 | raw_spin_unlock(&next->pi_lock); |
| 5639 | } | 5633 | } |
