Skip to content

Commit 937c6b2

Browse files
oleg-nesterovhtejun
authored andcommitted
cgroup: freezer: call cgroup_enter_frozen() with preemption disabled in ptrace_stop()
ptrace_stop() does preempt_enable_no_resched() to avoid the preemption, but after that cgroup_enter_frozen() does spin_lock/unlock and this adds another preemption point. Reported-and-tested-by: Bruce Ashfield <[email protected]> Fixes: 76f969e ("cgroup: cgroup v2 freezer") Cc: [email protected] # v5.2+ Signed-off-by: Oleg Nesterov <[email protected]> Acked-by: Roman Gushchin <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 9e208aa commit 937c6b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/signal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2205,8 +2205,8 @@ static void ptrace_stop(int exit_code, int why, int clear_code, kernel_siginfo_t
22052205
*/
22062206
preempt_disable();
22072207
read_unlock(&tasklist_lock);
2208-
preempt_enable_no_resched();
22092208
cgroup_enter_frozen();
2209+
preempt_enable_no_resched();
22102210
freezable_schedule();
22112211
cgroup_leave_frozen(true);
22122212
} else {

0 commit comments

Comments
 (0)