From: Davide Libenzi <davidel@xmailserver.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "David M. Lloyd" <dmlloyd@flurg.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [patch 2/5] signalfd v2 - signalfd core ...
Date: Thu, 8 Mar 2007 08:29:32 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.64.0703080825420.7015@alien.or.mcafeemobile.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0703080812290.10832@woody.linux-foundation.org>
On Thu, 8 Mar 2007, Linus Torvalds wrote:
> You missed David's worry, I think.
>
> Not only is POLLIN potentially an edge event (depending on the interface
> you use to fetch it), but even as a level-triggered one you generally want
> to read as much as possible per POLLIN event, and go back to the event
> loop only when you get EAGAIN.
>
> So that's in addition to the read/signal race with other
> threads/processes.
>
> You solved it by having a separate system call, but since it's a regular
> file descriptor, why have a new system call at all, and not just make it
> be a "read()"? In which case you definitely want O_NONBLOCK support.
>
> The UNIX philosophy is often quoted as "everything is a file", but that
> really means "everything is a stream of bytes".
>
> In Windows, you have 15 different versions of "read()" with sockets and
> files and pipes all having strange special cases and special system calls.
> That's not the UNIX way. It should be just a "read()", and then people can
> use general libraries and treat all sources the same.
>
> For example, the main select/poll/epoll loop may be the one doing all the
> reading, and then pass off "full buffers only" to the individual per-fd
> "action routines". And that kind of model really very fundamentally wants
> an fd to be an fd to be an fd - not "some file descriptors need
> 'read_from_sigfd()', and some file descriptors need 'read()', and some
> file descriptors need 'recvmsg()'" etc.
>
> So I think you should get rid of signalfd_dequeue(), and just replace it
> with a "read()" function.
The reason for the special function, was not to provide a non-blocking
behaviour with zero timeout (that just a side effect), but to read the
siginfo. I was all about using read(2) (and v1 used it), but when you have
to transfer complex structures over it, it becomes hell. How do you
cleanly compat over a f_op->read callback for example?
- Davide
next prev parent reply other threads:[~2007-03-08 16:29 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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
2007-03-09 1:16 ` 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.0703080825420.7015@alien.or.mcafeemobile.com \
--to=davidel@xmailserver.org \
--cc=akpm@linux-foundation.org \
--cc=dmlloyd@flurg.com \
--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®