History

cgroup/cpuset: Change cpuset_rwsem and hotplug lock order

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).

Juri Lelli committed 7 years ago

Commit d74b27d1 parent 1243dc52 files · +21 −9Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/cpuset.h+4−4
@@ -40,14 +40,14 @@ static inline bool cpusets_enabled(void) · 39 unmodified lines
40 40
41static inline void cpuset_inc(void)41static 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
47static inline void cpuset_dec(void)47static 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
53extern int cpuset_init(void);53extern int cpuset_init(void);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t