From: Oleg Nesterov <oleg@redhat.com>
To: Matt Fleming <matt@console-pimps.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
David Howells <dhowells@redhat.com>,
David Woodhouse <dwmw2@infradead.org>,
Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: do_signal: simplify the TS_RESTORE_SIGMASK logic
Date: Wed, 13 Jul 2011 17:23:31 +0200 [thread overview]
Message-ID: <20110713152331.GB4850@redhat.com> (raw)
In-Reply-To: <20110713102520.0065c7de@mfleming-mobl1.ger.corp.intel.com>
On 07/13, Matt Fleming wrote:
>
> On Sun, 10 Jul 2011 20:22:03 +0200
> Oleg Nesterov <oleg@redhat.com> wrote:
>
> > 1. do_signal() looks at TS_RESTORE_SIGMASK and calculates the
> > mask which should be stored in the signal frame, then it
> > passes "oldset" to the callees, down to setup_rt_frame().
> >
> > This is ugly, setup_rt_frame() can do this itself and nobody
> > else needs this sigset_t. Move this code into setup_rt_frame.
> >
> > 2. do_signal() also clears TS_RESTORE_SIGMASK if handle_signal()
> > succeeds.
> >
> > We can move this to setup_rt_frame() as well, this avoids the
> > unnecessary checks and makes the logic more clear.
> >
> > 3. use set_current_blocked() instead of sigprocmask(SIG_SETMASK),
> > sigprocmask() should be avoided.
>
> Could you please mention commit e6fa16ab "signal: sigprocmask() should
> do retarget_shared_pending()", since it's not immediately obvious in
> this changelog why sigprocmask() should be avoided.
Well, sigprocmask(SIG_SETMASK) is fine from the correctness pov,
it calls set_current_blocked().
sigprocmask() should be avoided because it is strange interface.
It has numeruos callers, but in fact almost all of them could use
set_current_blocked() (ignoring sys_rt_sigprocmask).
Linus suggested to simply kill sigprocmask(). I am not sure, but
at least it shouldn't be abused and its last argument is confusing.
> Reviewed-by: Matt Fleming <matt.fleming@linux.intel.com>
Thanks for looking!
Oleg.
next prev parent reply other threads:[~2011-07-13 15:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-10 18:22 [PATCH] x86: do_signal: simplify the TS_RESTORE_SIGMASK logic Oleg Nesterov
2011-07-10 21:08 ` Al Viro
2011-07-11 11:39 ` Oleg Nesterov
2011-07-13 9:25 ` Matt Fleming
2011-07-13 15:23 ` Oleg Nesterov [this message]
2011-07-15 5:47 ` [tip:x86/signal] x86, do_signal: Simplify " tip-bot for Oleg Nesterov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110713152331.GB4850@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matt@console-pimps.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.