* [PATCH -mm 1/2] wait_task_stopped: remove unneeded delay_group_leader check
@ 2007-11-23 19:59 Oleg Nesterov
2007-11-24 8:19 ` Mika Penttilä
2007-12-11 1:45 ` Roland McGrath
0 siblings, 2 replies; 3+ messages in thread
From: Oleg Nesterov @ 2007-11-23 19:59 UTC (permalink / raw)
To: Andrew Morton; +Cc: Roland McGrath, linux-kernel
wait_task_stopped() doesn't need the "delay_group_leader" parameter. If the
child is not traced it must be a group leader. With or without subthreads
->group_stop_count == 0 when the whole task is stopped.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
--- PT/kernel/exit.c~5_ck_group_stop 2007-11-22 19:08:43.000000000 +0300
+++ PT/kernel/exit.c 2007-11-23 20:31:21.000000000 +0300
@@ -1348,7 +1348,7 @@ static int wait_task_zombie(struct task_
* the lock and this task is uninteresting. If we return nonzero, we have
* released the lock and the system call should return.
*/
-static int wait_task_stopped(struct task_struct *p, int delayed_group_leader,
+static int wait_task_stopped(struct task_struct *p,
int noreap, struct siginfo __user *infop,
int __user *stat_addr, struct rusage __user *ru)
{
@@ -1362,8 +1362,7 @@ static int wait_task_stopped(struct task
if (unlikely(!is_task_stopped_or_traced(p)))
goto unlock_sig;
- if (delayed_group_leader && !(p->ptrace & PT_PTRACED) &&
- p->signal->group_stop_count > 0)
+ if (!(p->ptrace & PT_PTRACED) && p->signal->group_stop_count > 0)
/*
* A group stop is in progress and this is the group leader.
* We won't report until all threads have stopped.
@@ -1519,7 +1518,7 @@ repeat:
!(options & WUNTRACED))
continue;
- retval = wait_task_stopped(p, ret == 2,
+ retval = wait_task_stopped(p,
(options & WNOWAIT), infop,
stat_addr, ru);
} else if (p->exit_state == EXIT_ZOMBIE) {
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -mm 1/2] wait_task_stopped: remove unneeded delay_group_leader check
2007-11-23 19:59 [PATCH -mm 1/2] wait_task_stopped: remove unneeded delay_group_leader check Oleg Nesterov
@ 2007-11-24 8:19 ` Mika Penttilä
2007-12-11 1:45 ` Roland McGrath
1 sibling, 0 replies; 3+ messages in thread
From: Mika Penttilä @ 2007-11-24 8:19 UTC (permalink / raw)
To: Oleg Nesterov; +Cc: Andrew Morton, Roland McGrath, linux-kernel
> wait_task_stopped() doesn't need the "delay_group_leader" parameter. If the
> child is not traced it must be a group leader. With or without subthreads
>
What do you mean "has to be a group leader"? It could be a stopped thread.
> ->group_stop_count == 0 when the whole task is stopped.
>
>
> Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
>
> --- PT/kernel/exit.c~5_ck_group_stop 2007-11-22 19:08:43.000000000 +0300
> +++ PT/kernel/exit.c 2007-11-23 20:31:21.000000000 +0300
> @@ -1348,7 +1348,7 @@ static int wait_task_zombie(struct task_
> * the lock and this task is uninteresting. If we return nonzero, we have
> * released the lock and the system call should return.
> */
> -static int wait_task_stopped(struct task_struct *p, int delayed_group_leader,
> +static int wait_task_stopped(struct task_struct *p,
> int noreap, struct siginfo __user *infop,
> int __user *stat_addr, struct rusage __user *ru)
> {
> @@ -1362,8 +1362,7 @@ static int wait_task_stopped(struct task
> if (unlikely(!is_task_stopped_or_traced(p)))
> goto unlock_sig;
>
> - if (delayed_group_leader && !(p->ptrace & PT_PTRACED) &&
> - p->signal->group_stop_count > 0)
> + if (!(p->ptrace & PT_PTRACED) && p->signal->group_stop_count > 0)
> /*
> * A group stop is in progress and this is the group leader.
> * We won't report until all threads have stopped.
> @@ -1519,7 +1518,7 @@ repeat:
> !(options & WUNTRACED))
> continue;
>
> - retval = wait_task_stopped(p, ret == 2,
> + retval = wait_task_stopped(p,
> (options & WNOWAIT), infop,
> stat_addr, ru);
> } else if (p->exit_state == EXIT_ZOMBIE) {
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -mm 1/2] wait_task_stopped: remove unneeded delay_group_leader check
2007-11-23 19:59 [PATCH -mm 1/2] wait_task_stopped: remove unneeded delay_group_leader check Oleg Nesterov
2007-11-24 8:19 ` Mika Penttilä
@ 2007-12-11 1:45 ` Roland McGrath
1 sibling, 0 replies; 3+ messages in thread
From: Roland McGrath @ 2007-12-11 1:45 UTC (permalink / raw)
To: Oleg Nesterov; +Cc: Andrew Morton, linux-kernel
Your change looks correct to me.
Thanks,
Roland
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-12-11 1:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-23 19:59 [PATCH -mm 1/2] wait_task_stopped: remove unneeded delay_group_leader check Oleg Nesterov
2007-11-24 8:19 ` Mika Penttilä
2007-12-11 1:45 ` Roland McGrath
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®