From: Stephen Hemminger <shemminger@osdl.org>
To: "Marc Snider" <msnider@bluenotenetworks.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: Read/Write multiple network FDs in a single syscall context switch?
Date: Fri, 17 Nov 2006 20:24:40 -0800 [thread overview]
Message-ID: <20061117202440.267a9c25@localhost.localdomain> (raw)
In-Reply-To: <5A09CDB9FC09B1478DF679F4C698D1DB0482C9@johnleehooker.bluenote.local>
On Fri, 17 Nov 2006 22:53:26 -0500
"Marc Snider" <msnider@bluenotenetworks.com> wrote:
> Sorry, I must have given the wrong impression with respect to the data. It is not all the same. Each ingress socket is associated with an individual egress socket and the packet data being received and transmitted is unique across ingress/egress socket pairs...
>
> Guess I don't see the difficulties you alluded to below, Stephen. The userspace app would only ask to receive on sockets where there was already known data available as per Epoll reporting. I also think it a reasonable constraint to require in this multiple FD operation case that all sockets are mandated as nonblocking, thus a zero or some other unique return value could be provided for each socket that would have blocked in lieu of EWOULDBLOCK.
>
> Write sockets would only be written to when data was available, so there would be no ambiguity on write operations. Again, if the request could not be satisfied due to socket buffer overflow or other aberration a nonblocking return code would ensue.
>
> If all socket FDs referenced were required to be nonblocking then I'm having difficulty understanding how circumstances would differ for a vectorized recvMultiple() or sendMultiple() operation when contrasted with doing multiple individual recv() and/or send() calls on N nonblocking sockets...
>
> Forgive me if I'm missing something. It seems to me that the bang for the buck in exponentially reducing the number of context switches required for a userspace application to service many network FDs makes a great deal of sense here....
>
> Regards,
> Marc Snider
> msnider@bluenotenetworks.com
>
You forget on Linux system calls are cheap, unlike other OS's. A poll/select followed by a receive
is going to be as fast as any recv_any() type interface. Unless you can reduce the number
of copies from kernel to user (or vice versa) there is no point to inventing yet another
network interface.
next parent reply other threads:[~2006-11-18 4:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5A09CDB9FC09B1478DF679F4C698D1DB0482C9@johnleehooker.bluenote.local>
2006-11-18 4:24 ` Stephen Hemminger [this message]
2006-11-17 21:40 Read/Write multiple network FDs in a single syscall context switch? Marc Snider
2006-11-17 21:45 ` Stephen Hemminger
2006-11-18 4:19 ` Willy Tarreau
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=20061117202440.267a9c25@localhost.localdomain \
--to=shemminger@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=msnider@bluenotenetworks.com \
/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