mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Satyam Sharma" <satyam.sharma@gmail.com>
To: "Oleg Nesterov" <oleg@tv-sign.ru>
Cc: "Jeff Layton" <jlayton@redhat.com>,
	linux-kernel@vger.kernel.org,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	netdev@vger.kernel.org, linux-cifs-client@lists.samba.org
Subject: Re: [PATCH] RFC: have tcp_recvmsg() check kthread_should_stop() and treat it as if it were signalled
Date: Wed, 27 Jun 2007 06:59:35 +0530	[thread overview]
Message-ID: <a781481a0706261829l4a5c19cey7e1e75157fb74ce2@mail.gmail.com> (raw)
In-Reply-To: <a781481a0706261553i1e65e620o884708d0b068b0f8@mail.gmail.com>

On 6/27/07, Satyam Sharma <satyam.sharma@gmail.com> wrote:
> [...]
> On 6/26/07, Oleg Nesterov <oleg@tv-sign.ru> wrote:
> > On 06/26, Satyam Sharma wrote:
> [...]
> > > So could we have signals in _addition_ to kthread_stop_info and change
> > > kthread_should_stop() to check for both:
> > >
> > > kthread_stop_info.k == current && signal_pending(current)
> >
> > No, this can't work in general. Some kthreads do flush_signals/dequeue_signal,
> > so TIF_SIGPENDING can be lost anyway.
>
> Yup, I had thought of precisely this issue yesterday as well. The mental note
> I made to myself was that the force_sig(SIGKILL) and wake_up_process() in
> kthread_stop() must be atomic so that the following race is not possible:

Hmm, the issue seems to have more to do with the ordering of
flush_signals() w.r.t. checking kthread_should_stop() in the kthread's
code. I thought about how to tackle this, but there's no easy way to make
the stuff atomic like I thought earlier. The problem, like you mentioned,
is if the target kthread proactively flushes its signals by hand *before*
checking kthread_should_stop().

The only way out seems to be to simply outlaw flush_signals() in kthreads
(or anything to do with signals), but that would be impossible to enforce ...

Satyam

  reply	other threads:[~2007-06-27  1:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070605152340.f09fa6f2.jlayton@redhat.com>
     [not found] ` <20070606085550.GA7351@infradead.org>
2007-06-08 16:35   ` Jeff Layton
2007-06-09  1:30     ` Herbert Xu
2007-06-09 11:08       ` Jeff Layton
2007-06-25 19:41         ` Satyam Sharma
2007-06-25 19:52           ` Jeff Layton
2007-06-25 22:09             ` Satyam Sharma
2007-06-26  0:46               ` Jeff Layton
2007-06-26 11:54           ` Oleg Nesterov
2007-06-26 22:53             ` Satyam Sharma
2007-06-27  1:29               ` Satyam Sharma [this message]
2007-06-27 12:24               ` Oleg Nesterov
2007-06-28  0:44                 ` Satyam Sharma
2007-06-28 14:12                   ` Oleg Nesterov
2007-06-28 15:44                     ` Satyam Sharma
2007-06-28 16:19                       ` Satyam Sharma
2007-06-28 16:24                       ` Satyam Sharma
2007-06-28 17:08                       ` Oleg Nesterov
2007-06-28 18:41                         ` Jeff Layton
2007-06-28 19:22                         ` Satyam Sharma
2007-06-21 14:35   ` [linux-cifs-client] Re: [PATCH] CIFS: make cifsd (more) signal-safe Jeff Layton

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=a781481a0706261829l4a5c19cey7e1e75157fb74ce2@mail.gmail.com \
    --to=satyam.sharma@gmail.com \
    --cc=ebiederm@xmission.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jlayton@redhat.com \
    --cc=linux-cifs-client@lists.samba.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oleg@tv-sign.ru \
    /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

all inboxes | Powered by JetHome®