diff options
Diffstat (limited to 'kernel/sched/core.c')
-rw-r--r-- | kernel/sched/core.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 34db9bf892a3..57bd333bc4ab 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -6999,27 +6999,23 @@ static int cpuset_cpu_inactive(struct notifier_block *nfb, unsigned long action, | |||
6999 | unsigned long flags; | 6999 | unsigned long flags; |
7000 | long cpu = (long)hcpu; | 7000 | long cpu = (long)hcpu; |
7001 | struct dl_bw *dl_b; | 7001 | struct dl_bw *dl_b; |
7002 | bool overflow; | ||
7003 | int cpus; | ||
7002 | 7004 | ||
7003 | switch (action & ~CPU_TASKS_FROZEN) { | 7005 | switch (action) { |
7004 | case CPU_DOWN_PREPARE: | 7006 | case CPU_DOWN_PREPARE: |
7005 | /* explicitly allow suspend */ | 7007 | rcu_read_lock_sched(); |
7006 | if (!(action & CPU_TASKS_FROZEN)) { | 7008 | dl_b = dl_bw_of(cpu); |
7007 | bool overflow; | ||
7008 | int cpus; | ||
7009 | |||
7010 | rcu_read_lock_sched(); | ||
7011 | dl_b = dl_bw_of(cpu); | ||
7012 | 7009 | ||
7013 | raw_spin_lock_irqsave(&dl_b->lock, flags); | 7010 | raw_spin_lock_irqsave(&dl_b->lock, flags); |
7014 | cpus = dl_bw_cpus(cpu); | 7011 | cpus = dl_bw_cpus(cpu); |
7015 | overflow = __dl_overflow(dl_b, cpus, 0, 0); | 7012 | overflow = __dl_overflow(dl_b, cpus, 0, 0); |
7016 | raw_spin_unlock_irqrestore(&dl_b->lock, flags); | 7013 | raw_spin_unlock_irqrestore(&dl_b->lock, flags); |
7017 | 7014 | ||
7018 | rcu_read_unlock_sched(); | 7015 | rcu_read_unlock_sched(); |
7019 | 7016 | ||
7020 | if (overflow) | 7017 | if (overflow) |
7021 | return notifier_from_errno(-EBUSY); | 7018 | return notifier_from_errno(-EBUSY); |
7022 | } | ||
7023 | cpuset_update_active_cpus(false); | 7019 | cpuset_update_active_cpus(false); |
7024 | break; | 7020 | break; |
7025 | case CPU_DOWN_PREPARE_FROZEN: | 7021 | case CPU_DOWN_PREPARE_FROZEN: |