diff options
| author | Peter Zijlstra <peterz@infradead.org> | 2023-06-09 20:45:16 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-04-03 15:28:18 +0200 |
| commit | c4c2f7e672e780be0bb867bd7e18ca53d16bc8da (patch) | |
| tree | e7fae06ff49ce79c477c5fb5c52e65efd0f5e36b /include/linux/cpu.h | |
| parent | 0641908b906a133f1494c312a71f9fecbe2b6c78 (diff) | |
sched: Simplify tg_set_cfs_bandwidth()
[ Upstream commit 6fb45460615358157a6d3c990e74f9c1395247e2 ]
Use guards to reduce gotos and simplify control flow.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Stable-dep-of: 1aa09b9379a7 ("powercap: intel_rapl: Fix locking in TPMI RAPL")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux/cpu.h')
| -rw-r--r-- | include/linux/cpu.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 59dd421a8e35..e990c180282e 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -157,6 +157,8 @@ static inline int remove_cpu(unsigned int cpu) { return -EPERM; } static inline void smp_shutdown_nonboot_cpus(unsigned int primary_cpu) { } #endif /* !CONFIG_HOTPLUG_CPU */ +DEFINE_LOCK_GUARD_0(cpus_read_lock, cpus_read_lock(), cpus_read_unlock()) + #ifdef CONFIG_PM_SLEEP_SMP extern int freeze_secondary_cpus(int primary); extern void thaw_secondary_cpus(void); |
