From: Oleg Nesterov <oleg@tv-sign.ru>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Avi Kivity <avi@argo.co.il>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [patch 2/5] signalfd v2 - signalfd core ...
Date: Fri, 9 Mar 2007 03:14:08 +0300 [thread overview]
Message-ID: <20070309001408.GA6801@tv-sign.ru> (raw)
In-Reply-To: <Pine.LNX.4.64.0703081459350.4882@alien.or.mcafeemobile.com>
On 03/08, Davide Libenzi wrote:
>
> On Fri, 9 Mar 2007, Oleg Nesterov wrote:
>
> > > Logic is, if it's not an RT signal, queue only one, otherwise multiple.
> > > The bit on the ->pending mask is clealer only when the queue slot becomes empty.
> >
> > Yes, I see what the code does, but I don't undestand why. For example, SIGCHLD was
> > delivered to the process _and_ handled several times, then sys_signalfd_dequeue()
> > comes and finds only one siginfo. Isn't this strange?
>
> That's the same logic the kernel folows for non-RT signals.
Yes, specific_send_sig_info/__group_send_sig_info "ignores" the non-RT signal
- if we already have a pending one (blocked, or not yet handled)
- the only reason is backward compatibility
signalfd:
- if the same signr was not fetched via sys_signalfd_dequeue()
- the reason is ????
Suppose we are doing a simple application which just logs all signals
which were sent to this process. Now, we can miss the signal if the
logging blocks.
Think about sub-threads. We can send the same non-RT signal to T1, T2, T3
via specific_send_sig_info(). All 3 signals will be delivered, but signalfd
(which is process wide) will see only the first.
> > > The two trasports can rely on different masks. The signalfd_notify() does
> > > not even go in signalfd_deliver() if no signalfds are attached to the
> > > sighand.
> >
> > Sorry, I don't understand. The masks are different, yes, but ->sighand is the
> > same? How this can make any difference for "if no signalfds are attached" ?
>
> The list_empty() che would not make you fall inside signalfd_deliver(),
> hence the fast path really lives up to its name ;)
Ugh. Still can't understand, probably I missed something or misread this patch.
If we shift signalfd_notify() from specific_send_sig_info/__group_send_sig_info
to send_signal(), we have the same "list_empty()" fastpath if no signalfds are
attached to the sighand. The difference is that we don't count sig_ignored()
signals, which looks right to me.
Oleg.
next prev parent reply other threads:[~2007-03-09 0:14 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-08 20:43 Oleg Nesterov
2007-03-08 21:12 ` Davide Libenzi
2007-03-08 21:56 ` Oleg Nesterov
2007-03-08 22:11 ` Linus Torvalds
2007-03-08 22:59 ` Davide Libenzi
2007-03-08 23:05 ` Davide Libenzi
2007-03-09 0:14 ` Oleg Nesterov [this message]
2007-03-09 1:16 ` Davide Libenzi
-- strict thread matches above, loose matches on Subject: below --
2007-03-08 1:21 Davide Libenzi
2007-03-08 14:31 ` David M. Lloyd
2007-03-08 15:45 ` Davide Libenzi
2007-03-08 16:22 ` Linus Torvalds
2007-03-08 16:29 ` Davide Libenzi
2007-03-08 16:40 ` Michael K. Edwards
2007-03-08 17:28 ` Linus Torvalds
2007-03-08 20:53 ` Michael K. Edwards
2007-03-30 23:24 ` Denis Vlasenko
2007-03-08 17:15 ` Linus Torvalds
2007-03-08 19:21 ` Davide Libenzi
2007-03-08 19:27 ` Linus Torvalds
2007-03-08 19:33 ` Davide Libenzi
2007-03-08 20:48 ` Marko Macek
2007-03-08 21:03 ` Marko Macek
2007-03-09 20:22 ` Kent Overstreet
2007-03-08 19:34 ` Avi Kivity
2007-03-08 19:40 ` Davide Libenzi
2007-03-08 23:57 ` Jeremy Fitzhardinge
2007-03-09 0:10 ` Linus Torvalds
2007-03-09 21:33 ` 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=20070309001408.GA6801@tv-sign.ru \
--to=oleg@tv-sign.ru \
--cc=akpm@linux-foundation.org \
--cc=avi@argo.co.il \
--cc=davidel@xmailserver.org \
--cc=linux-kernel@vger.kernel.org \
--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®