diff options
author | Oleg Nesterov <oleg@redhat.com> | 2010-03-15 05:10:03 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-04-02 14:12:01 -0400 |
commit | 897f0b3c3ff40b443c84e271bef19bd6ae885195 (patch) | |
tree | 6b969149bb59591a1c9485de405639db6c4208d6 /include/linux/cpuset.h | |
parent | 25c2d55c00c6097e6792ebf21e31342f23b9b768 (diff) |
sched: Kill the broken and deadlockable cpuset_lock/cpuset_cpus_allowed_locked code
This patch just states the fact the cpusets/cpuhotplug interaction is
broken and removes the deadlockable code which only pretends to work.
- cpuset_lock() doesn't really work. It is needed for
cpuset_cpus_allowed_locked() but we can't take this lock in
try_to_wake_up()->select_fallback_rq() path.
- cpuset_lock() is deadlockable. Suppose that a task T bound to CPU takes
callback_mutex. If cpu_down(CPU) happens before T drops callback_mutex
stop_machine() preempts T, then migration_call(CPU_DEAD) tries to take
cpuset_lock() and hangs forever because CPU is already dead and thus
T can't be scheduled.
- cpuset_cpus_allowed_locked() is deadlockable too. It takes task_lock()
which is not irq-safe, but try_to_wake_up() can be called from irq.
Kill them, and change select_fallback_rq() to use cpu_possible_mask, like
we currently do without CONFIG_CPUSETS.
Also, with or without this patch, with or without CONFIG_CPUSETS, the
callers of select_fallback_rq() can race with each other or with
set_cpus_allowed() pathes.
The subsequent patches try to to fix these problems.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20100315091003.GA9123@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/cpuset.h')
-rw-r--r-- | include/linux/cpuset.h | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index a5740fc4d04b..eeaaee746bee 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
@@ -21,8 +21,6 @@ extern int number_of_cpusets; /* How many cpusets are defined in system? */ | |||
21 | extern int cpuset_init(void); | 21 | extern int cpuset_init(void); |
22 | extern void cpuset_init_smp(void); | 22 | extern void cpuset_init_smp(void); |
23 | extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask); | 23 | extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask); |
24 | extern void cpuset_cpus_allowed_locked(struct task_struct *p, | ||
25 | struct cpumask *mask); | ||
26 | extern nodemask_t cpuset_mems_allowed(struct task_struct *p); | 24 | extern nodemask_t cpuset_mems_allowed(struct task_struct *p); |
27 | #define cpuset_current_mems_allowed (current->mems_allowed) | 25 | #define cpuset_current_mems_allowed (current->mems_allowed) |
28 | void cpuset_init_current_mems_allowed(void); | 26 | void cpuset_init_current_mems_allowed(void); |
@@ -69,9 +67,6 @@ struct seq_file; | |||
69 | extern void cpuset_task_status_allowed(struct seq_file *m, | 67 | extern void cpuset_task_status_allowed(struct seq_file *m, |
70 | struct task_struct *task); | 68 | struct task_struct *task); |
71 | 69 | ||
72 | extern void cpuset_lock(void); | ||
73 | extern void cpuset_unlock(void); | ||
74 | |||
75 | extern int cpuset_mem_spread_node(void); | 70 | extern int cpuset_mem_spread_node(void); |
76 | 71 | ||
77 | static inline int cpuset_do_page_mem_spread(void) | 72 | static inline int cpuset_do_page_mem_spread(void) |
@@ -105,11 +100,6 @@ static inline void cpuset_cpus_allowed(struct task_struct *p, | |||
105 | { | 100 | { |
106 | cpumask_copy(mask, cpu_possible_mask); | 101 | cpumask_copy(mask, cpu_possible_mask); |
107 | } | 102 | } |
108 | static inline void cpuset_cpus_allowed_locked(struct task_struct *p, | ||
109 | struct cpumask *mask) | ||
110 | { | ||
111 | cpumask_copy(mask, cpu_possible_mask); | ||
112 | } | ||
113 | 103 | ||
114 | static inline nodemask_t cpuset_mems_allowed(struct task_struct *p) | 104 | static inline nodemask_t cpuset_mems_allowed(struct task_struct *p) |
115 | { | 105 | { |
@@ -157,9 +147,6 @@ static inline void cpuset_task_status_allowed(struct seq_file *m, | |||
157 | { | 147 | { |
158 | } | 148 | } |
159 | 149 | ||
160 | static inline void cpuset_lock(void) {} | ||
161 | static inline void cpuset_unlock(void) {} | ||
162 | |||
163 | static inline int cpuset_mem_spread_node(void) | 150 | static inline int cpuset_mem_spread_node(void) |
164 | { | 151 | { |
165 | return 0; | 152 | return 0; |