diff options
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/fair.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 897d97762d8a..f6308cb44d09 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
@@ -3225,6 +3225,13 @@ static int do_sched_cfs_period_timer(struct cfs_bandwidth *cfs_b, int overrun) | |||
3225 | if (idle) | 3225 | if (idle) |
3226 | goto out_unlock; | 3226 | goto out_unlock; |
3227 | 3227 | ||
3228 | /* | ||
3229 | * if we have relooped after returning idle once, we need to update our | ||
3230 | * status as actually running, so that other cpus doing | ||
3231 | * __start_cfs_bandwidth will stop trying to cancel us. | ||
3232 | */ | ||
3233 | cfs_b->timer_active = 1; | ||
3234 | |||
3228 | __refill_cfs_bandwidth_runtime(cfs_b); | 3235 | __refill_cfs_bandwidth_runtime(cfs_b); |
3229 | 3236 | ||
3230 | if (!throttled) { | 3237 | if (!throttled) { |
@@ -3493,11 +3500,11 @@ void __start_cfs_bandwidth(struct cfs_bandwidth *cfs_b) | |||
3493 | * (timer_active==0 becomes visible before the hrtimer call-back | 3500 | * (timer_active==0 becomes visible before the hrtimer call-back |
3494 | * terminates). In either case we ensure that it's re-programmed | 3501 | * terminates). In either case we ensure that it's re-programmed |
3495 | */ | 3502 | */ |
3496 | while (unlikely(hrtimer_active(&cfs_b->period_timer))) { | 3503 | while (unlikely(hrtimer_active(&cfs_b->period_timer)) && |
3504 | hrtimer_try_to_cancel(&cfs_b->period_timer) < 0) { | ||
3505 | /* bounce the lock to allow do_sched_cfs_period_timer to run */ | ||
3497 | raw_spin_unlock(&cfs_b->lock); | 3506 | raw_spin_unlock(&cfs_b->lock); |
3498 | /* ensure cfs_b->lock is available while we wait */ | 3507 | cpu_relax(); |
3499 | hrtimer_cancel(&cfs_b->period_timer); | ||
3500 | |||
3501 | raw_spin_lock(&cfs_b->lock); | 3508 | raw_spin_lock(&cfs_b->lock); |
3502 | /* if someone else restarted the timer then we're done */ | 3509 | /* if someone else restarted the timer then we're done */ |
3503 | if (cfs_b->timer_active) | 3510 | if (cfs_b->timer_active) |