Skip to content

Commit

Permalink
UPSTREAM: cgroup: freezer: call cgroup_enter_frozen() with preemption…
Browse files Browse the repository at this point in the history
… 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: 76f969e8948d ("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]>

Change-Id: Ic53e0f2d6624b0bb90817b0c57060fb7db971348
(cherry picked from commit 937c6b27c73e02cd4114f95f5c37ba2c29fadba1)
Bug: 154548692
Signed-off-by: Marco Ballesio <[email protected]>
  • Loading branch information
oleg-nesterov authored and nadinsylaa committed Aug 26, 2020
1 parent fe5770a commit caf7cac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -2131,8 +2131,8 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info)
*/
preempt_disable();
read_unlock(&tasklist_lock);
preempt_enable_no_resched();
cgroup_enter_frozen();
preempt_enable_no_resched();
freezable_schedule();
cgroup_leave_frozen(true);
} else {
Expand Down

0 comments on commit caf7cac

Please sign in to comment.