cpuset_rwsem is going to be acquired from sched_setscheduler() with a following patch. There are however paths (e.g., spawn_ksoftirqd) in which sched_scheduler() is eventually called while holding hotplug lock; this creates a dependecy between hotplug lock (to be always acquired first) and cpuset_rwsem (to be always acquired after hotplug lock). Fix paths which currently take the two locks in the wrong order (after a following patch is applied).
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -40,14 +40,14 @@ static inline bool cpusets_enabled(void) · 39 unmodified lines | |||
| 40 | 40 | ||
| 41 | static inline void cpuset_inc(void) | 41 | static inline void cpuset_inc(void) |
| 42 | { | 42 | { |
| 43 | static_branch_inc(&cpusets_pre_enable_key); | 43 | static_branch_inc_cpuslocked(&cpusets_pre_enable_key); |
| 44 | static_branch_inc(&cpusets_enabled_key); | 44 | static_branch_inc_cpuslocked(&cpusets_enabled_key); |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | static inline void cpuset_dec(void) | 47 | static inline void cpuset_dec(void) |
| 48 | { | 48 | { |
| 49 | static_branch_dec(&cpusets_enabled_key); | 49 | static_branch_dec_cpuslocked(&cpusets_enabled_key); |
| 50 | static_branch_dec(&cpusets_pre_enable_key); | 50 | static_branch_dec_cpuslocked(&cpusets_pre_enable_key); |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | extern int cpuset_init(void); | 53 | extern int cpuset_init(void); |