From: Andrew Morton <akpm@linux-foundation.org>
To: ebiederm@xmission.com (Eric W. Biederman)
Cc: Oleg Nesterov <oleg@tv-sign.ru>,
Davide Libenzi <davidel@xmailserver.org>,
Ingo Molnar <mingo@elte.hu>, Roland McGrath <roland@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] change kernel threads to ignore signals instead of blocking them
Date: Fri, 13 Apr 2007 14:08:02 -0700 [thread overview]
Message-ID: <20070413140802.3798a6bc.akpm@linux-foundation.org> (raw)
In-Reply-To: <m1bqhspdkj.fsf@ebiederm.dsl.xmission.com>
On Fri, 13 Apr 2007 08:13:32 -0600
ebiederm@xmission.com (Eric W. Biederman) wrote:
> Oleg Nesterov <oleg@tv-sign.ru> writes:
>
> > On top of Eric's
> >
> > kthread-dont-depend-on-work-queues-take-2.patch
> >
> > Currently kernel threads use sigprocmask(SIG_BLOCK) to protect against signals.
> > This doesn't prevent the signal delivery, this only blocks signal_wake_up().
> > Every "killall -33 kthreadd" means a "struct siginfo" leak.
> >
> > Change kthreadd_setup() to set all handlers to SIG_IGN instead of blocking them
> > (make a new helper ignore_signals() for that). If the kernel thread needs some
> > signal, it should use allow_signal() anyway, and in that case it should not use
> > CLONE_SIGHAND.
> >
> > Note that we can't change daemonize() (should die!) in the same way, because
> > it can be used along with CLONE_SIGHAND. This means that allow_signal() still
> > should unblock the signal to work correctly with daemonize()ed threads.
> >
> > However, disallow_signal() doesn't block the signal any longer but ignores it.
> >
> > NOTE: with or without this patch the kernel threads are not protected from
> > handle_stop_signal(), this seems harmless, but not good.
>
> Hmm. I like it all except for disallow_signal.
>
> disallow_signal currently only has one user, jffs2. While jffs2
> currently doesn't care, given the way jffs2 is using disallow_signal I
> would expect it would prefer to have the signal blocked.
>
> Thinking about this some more if jffs2 or anyone else wants blocked
> signal behavior they can go ahead and block the signal. Keeping
> disallow_signal in sync with allow_signal seems to make sense.
jffs2 actually wants its head examined. W. T. F. does it think it's
doing in there?
Sigh.
next prev parent reply other threads:[~2007-04-13 21:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-13 7:31 Oleg Nesterov
2007-04-13 14:13 ` Eric W. Biederman
2007-04-13 21:08 ` Andrew Morton [this message]
2007-04-13 21:36 ` Eric W. Biederman
2007-04-24 2:45 ` Andrew Morton
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=20070413140802.3798a6bc.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=davidel@xmailserver.org \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oleg@tv-sign.ru \
--cc=roland@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome