mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Davide Libenzi <davidel@xmailserver.org>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>
Subject: Re: [patch 2/13] signal/timer/event fds v7 - signalfd core ...
Date: Mon, 19 Mar 2007 17:20:20 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0703191718020.3733@alien.or.mcafeemobile.com> (raw)
In-Reply-To: <20070320001310.GA327@tv-sign.ru>

On Tue, 20 Mar 2007, Oleg Nesterov wrote:

> On 03/19, Davide Libenzi wrote:
> >
> > +struct signalfd_lockctx {
> > +	struct task_struct *tsk;
> > +	struct sighand_struct *sighand;
> > +	unsigned long flags;
> > +};
> 
> signalfd_lockctx is "private" to signalfd_lock/signalfd_unlock. But lk->sighand
> is used only by signalfd_lock(). I'd suggest to remove it.

Ack



> > +void signalfd_deliver(struct task_struct *tsk, int sig)
> > +{
> > +	struct sighand_struct *sighand = tsk->sighand;
> > +	struct signalfd_ctx *ctx, *tmp;
> > +
> > +	list_for_each_entry_safe(ctx, tmp, &sighand->sfdlist, lnk) {
> > +		/*
> > +		 * We use a negative signal value as a way to broadcast that the
> > +		 * sighand has been orphaned, so that we can notify all the
> > +		 * listeners about this. Remeber the ctx->sigmask is inverted,
> > +		 * so if the user is interested in a signal, that corresponding
> > +		 * bit will be zero.
> > +		 */
> > +		if (sig < 0) {
> > +			if (ctx->tsk == tsk) {
> > +				ctx->tsk = NULL;
> > +				list_del_init(&ctx->lnk);
> > +				wake_up(&ctx->wqh);
> > +			}
> > +		} else if (sig > 0) {
> > +			if (!sigismember(&ctx->sigmask, sig))
> > +				wake_up(&ctx->wqh);
> > +		}
> > +	}
> > +}
> 
> I tried to avoid this comment, but can't help myself :)

Added BUG_ON() and using "else".



- Davide



  reply	other threads:[~2007-03-20  0:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <send-serie.davidel@xmailserver.org.15249.1174348071.2>
2007-03-20  0:13 ` Oleg Nesterov
2007-03-20  0:20   ` Davide Libenzi [this message]
2007-03-20  0:22 ` Oleg Nesterov
2007-03-20  0:24   ` Davide Libenzi
     [not found] <Pine.LNX.4.64.0703271506080.5424@alien.or.mcafeemobile.com>
2007-03-30 19:39 ` Andrew Morton
2007-03-31  0:29   ` Davide Libenzi

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.0703191718020.3733@alien.or.mcafeemobile.com \
    --to=davidel@xmailserver.org \
    --cc=akpm@linux-foundation.org \
    --cc=ebiederm@xmission.com \
    --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®