mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Davide Libenzi <davidel@xmailserver.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Oleg Nesterov <oleg@tv-sign.ru>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: Re: [patch] exclude sync signals from signalfd sets
Date: Wed, 20 Jun 2007 13:12:47 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0706201309280.4018@alien.or.mcafeemobile.com> (raw)
In-Reply-To: <alpine.LFD.0.98.0706201255530.3593@woody.linux-foundation.org>

On Wed, 20 Jun 2007, Linus Torvalds wrote:

> 
> 
> On Wed, 20 Jun 2007, Davide Libenzi wrote:
> > 
> > The following patch excludes synchronous signals from being dequeued
> > by a signalfd.
> 
> I really prefer the current code. Listign special cases is just ugly. Just 
> make it so that thread-local signals stay thread-local, and it's all good.

Hmm, I thought the behaviour implemented by the patch was pretty clean. 
But anyway, if we leave the current code (as it is in your current tree), 
we need the patch below to avoid spurious poll returns.



- Davide


---
 fs/signalfd.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6.mod/fs/signalfd.c
===================================================================
--- linux-2.6.mod.orig/fs/signalfd.c	2007-06-20 13:08:25.000000000 -0700
+++ linux-2.6.mod/fs/signalfd.c	2007-06-20 13:09:00.000000000 -0700
@@ -133,7 +133,8 @@
 	 * the peer disconnects.
 	 */
 	if (signalfd_lock(ctx, &lk)) {
-		if (next_signal(&lk.tsk->pending, &ctx->sigmask) > 0 ||
+		if ((lk.tsk == current &&
+		     next_signal(&lk.tsk->pending, &ctx->sigmask) > 0) ||
 		    next_signal(&lk.tsk->signal->shared_pending,
 				&ctx->sigmask) > 0)
 			events |= POLLIN;

  reply	other threads:[~2007-06-20 20:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-20 19:14 Davide Libenzi
2007-06-20 19:56 ` Linus Torvalds
2007-06-20 20:12   ` Davide Libenzi [this message]
2007-06-21  9:27   ` 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=Pine.LNX.4.64.0706201309280.4018@alien.or.mcafeemobile.com \
    --to=davidel@xmailserver.org \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@tv-sign.ru \
    --cc=torvalds@linux-foundation.org \
    /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®