lkml.org 
[lkml]   [2007]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] do_sigaction: don't worry about signal_pending()
On 08/22, Jarek Poplawski wrote:
>
> On 20-08-2007 18:01, Oleg Nesterov wrote:
> > do_sigaction() returns -ERESTARTNOINTR if signal_pending(). The comment says:
> >
> > * If there might be a fatal signal pending on multiple
> > * threads, make sure we take it before changing the action.
> >
> > I think this is not needed. We should only worry about SIGNAL_GROUP_EXIT case,
> > bit it implies a pending SIGKILL which can't be cleared by do_sigaction.
>
> Isn't it for optimization e.g., to skip this 'do while' loop below for
> such multiple threads, which would get SIGKILL or SIGSTOP anyway?

Yes, in that case this 'do while' doesn't make sense. But this is very
unlikely, sigaction() shouldn't be called too much often, better to save
a couple of bytes from icache.

Also, please note that sigaction() is not special, almost any system call
could be started with

if (current->signal->flags & SIGNAL_GROUP_EXIT)
return ANYVALUE;

to "optimize" for the case when the task is dying.

Oleg.

-
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/

\
 
 \ /
  Last update: 2007-08-22 12:29    [W:0.056 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site