lkml.org 
[lkml]   [2011]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] has_stopped_jobs: s/task_is_stopped/SIGNAL_STOP_STOPPED/
On Thu, Jul 07, 2011 at 09:33:54PM +0200, Oleg Nesterov wrote:
> has_stopped_jobs() naively checks task_is_stopped(group_leader). This
> was always wrong even without ptrace, group_leader can be dead. And
> given that ptrace can change the state to TRACED this is wrong even
> in the single-threaded case.
>
> Change the code to check SIGNAL_STOP_STOPPED and simplify the code,
> retval + break/continue doesn't make this trivial code more readable.
>
> We could probably add the usual "|| signal->group_stop_count" check
> but I don't think this makes sense, the task can start the group-stop
> right after the check anyway.
>
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>

Acked-by: Tejun Heo <tj@kernel.org>

As for "|| signal->group_stop_count", it might be better to use the
same wrapper here too for consistency if we add one.

Thank you.

--
tejun


\
 
 \ /
  Last update: 2011-07-13 12:19    [W:0.048 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site