aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/signal.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-03-23 05:37:00 -0400
committerTejun Heo <tj@kernel.org>2011-03-23 05:37:00 -0400
commit0ae8ce1c8c5b9007ce6bfc83ec2aa0dfce5bbed3 (patch)
treef92abf6b41e9524966849972427fadcb7a7ef3f7 /kernel/signal.c
parent39efa3ef3a376a4e53de2f82fc91182459d34200 (diff)
ptrace: Participate in group stop from ptrace_stop() iff the task is trapping for group stop
Currently, ptrace_stop() unconditionally participates in group stop bookkeeping. This is unnecessary and inaccurate. Make it only participate if the task is trapping for group stop - ie. if @why is CLD_STOPPED. As ptrace_stop() currently is not used when trapping for group stop, this equals to disabling group stop participation from ptrace_stop(). A visible behavior change is increased likelihood of delayed group stop completion if the thread group contains one or more ptraced tasks. This is to preapre for further cleanup of the interaction between group stop and ptrace. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Oleg Nesterov <oleg@redhat.com> Cc: Roland McGrath <roland@redhat.com>
Diffstat (limited to 'kernel/signal.c')
-rw-r--r--kernel/signal.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index a2e7a6527d24..9f36dd2e8d5a 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1694,10 +1694,13 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info)
1694 } 1694 }
1695 1695
1696 /* 1696 /*
1697 * If there is a group stop in progress, 1697 * If @why is CLD_STOPPED, we're trapping to participate in a group
1698 * we must participate in the bookkeeping. 1698 * stop. Do the bookkeeping. Note that if SIGCONT was delievered
1699 * while siglock was released for the arch hook, PENDING could be
1700 * clear now. We act as if SIGCONT is received after TASK_TRACED
1701 * is entered - ignore it.
1699 */ 1702 */
1700 if (current->group_stop & GROUP_STOP_PENDING) 1703 if (why == CLD_STOPPED && (current->group_stop & GROUP_STOP_PENDING))
1701 task_participate_group_stop(current); 1704 task_participate_group_stop(current);
1702 1705
1703 current->last_siginfo = info; 1706 current->last_siginfo = info;