[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121224170540.GB9553@redhat.com>
Date: Mon, 24 Dec 2012 18:05:40 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Andrey Vagin <avagin@...nvz.org>
Cc: linux-kernel@...r.kernel.org, criu@...nvz.org,
linux-fsdevel@...r.kernel.org,
Alexander Viro <viro@...iv.linux.org.uk>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
David Howells <dhowells@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Michael Kerrisk <mtk.manpages@...il.com>,
Pavel Emelyanov <xemul@...allels.com>,
Cyrill Gorcunov <gorcunov@...nvz.org>
Subject: Re: [PATCH 3/4] signalfd: add ability to choose a private or
shared queue
On 12/24, Andrey Vagin wrote:
>
> static ssize_t signalfd_dequeue(struct signalfd_ctx *ctx, siginfo_t *info,
> - int nonblock)
> + int nonblock, int queue)
> {
> ssize_t ret;
> DECLARE_WAITQUEUE(wait, current);
>
> spin_lock_irq(¤t->sighand->siglock);
> - ret = dequeue_signal(current, &ctx->sigmask, info);
> + ret = do_dequeue_signal(current, &ctx->sigmask, info, queue);
Hmm. queue != 0 && !nonblock ?
And in this case you should also update signalfd_poll().
> + if (file->f_flags & SFD_GROUP)
> + queue++;
> +
> + if (file->f_flags & SFD_PRIVATE)
> + queue--;
To be honest, personally I think this looks ugly. If you add an
argumemt to dequeue_signal() it would be better to use bitmask.
But this is minor.
Well. Perhaps we can avoid all these complications? IIUC, all you
need is to know if the dequeued signal is private or shared. Since
you add SFD_RAW anyway perhaps we can report this fact instead?
This doesn't need any changes in signal.c, signalfd_dequeue() can
easily know which queue dequeue_signal() will use.
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists