From: Oleg Nesterov <oleg@redhat.com>
To: Petr Vandrovec <petr@vandrovec.name>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
Matt Fleming <matt@console-pimps.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH 40/41] ncpfs: Use set_current_blocked()
Date: Thu, 18 Aug 2011 19:05:38 +0200 [thread overview]
Message-ID: <20110818170538.GA6910@redhat.com> (raw)
In-Reply-To: <CA+i2_De=mKMHj++b5=ZPdXxp7pm2KzY+PzCaG++GWSud20a_qQ@mail.gmail.com>
On 08/17, Petr Vandrovec wrote:
>
> I do not care about 'intr' support, but regular code path blocking all
> signals has to stay.
I do not care about SIGINT/SIGQUIT check, just I simply can't understand
the logic.
But PF_EXITING/SIGKILL code looks absolutely strange.
> PF_EXITING code is there because in the past something was BUG_ON-ing that
> nobody should touch signals while exiting,
Not sure I understand... do you mean we have a kernel bug? it should be
fixed then.
> and same code made sure you
> cannot send signals to exiting process.
Again, can't understand.
A PF_EXITING doesn't need to block the signals at all. See wants_siganl().
But, otoh, even sigblock(SIGKILL) can't protect from SIGKILL or another
fatal signal if this thread has a live subthread.
However, blocking SIGKILL makes the difference if it exits with the pending
SIGKILL. In this case recalc_sigpending() clears TIF_SIGPENDING, this "helps"
to actually sleep in TASK_INTERRUPTIBLE.
At the same time, ncp_do_request() can unblock, say, SIGINT. And this
means that if this task exits because it was killed by SIGINT it won't
block anyway.
And I can't understand why it if fine to kill the live task, but not fine
to interrupt the exiting task. If this was intended. And if you want to
block all signals, why can't you do wait_event_uninterruptible() instead?
Or interruptible/uninterruptible depending on PF_EXITING.
Now suppose it is not PF_EXITING. In this case it is pointless to block
any fatal signal unless this task is single-threaded.
So far I think this code does not understand what it does ;)
OK. I guess nobody cares. Matt, could you redo your original patch?
just remove ->siglock and convert it to use set_current_blocked()
leaving this logic alone.
Oleg.
next prev parent reply other threads:[~2011-08-18 17:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1313071035-12047-1-git-send-email-matt@console-pimps.org>
[not found] ` <1313071035-12047-41-git-send-email-matt@console-pimps.org>
[not found] ` <20110816175643.GI29190@redhat.com>
[not found] ` <1313528170.3436.200.camel@mfleming-mobl1.ger.corp.intel.com>
[not found] ` <20110817120405.GA10709@redhat.com>
2011-08-17 13:58 ` [PATCH 40/41] ncpfs: Use set_current_blocked() Matt Fleming
2011-08-17 14:41 ` Oleg Nesterov
[not found] ` <CA+i2_De=mKMHj++b5=ZPdXxp7pm2KzY+PzCaG++GWSud20a_qQ@mail.gmail.com>
2011-08-18 17:05 ` Oleg Nesterov [this message]
2011-08-18 20:09 ` Matt Fleming
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=20110818170538.GA6910@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matt@console-pimps.org \
--cc=petr@vandrovec.name \
--cc=viro@zeniv.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).