netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: Steven Whitehouse <steve@chygwyn.com>
Cc: Evgeniy Polyakov <zbr@ioremap.net>,
	David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org, Chris Van Hoof <vanhoof@redhat.com>,
	Clark Williams <williams@redhat.com>
Subject: Re: [RFC 1/2] net: Introduce recvmmsg socket syscall
Date: Thu, 21 May 2009 13:45:45 -0300	[thread overview]
Message-ID: <20090521164545.GJ5956@ghostprotocols.net> (raw)
In-Reply-To: <1242923615.29604.409.camel@localhost.localdomain>

Em Thu, May 21, 2009 at 05:33:35PM +0100, Steven Whitehouse escreveu:
> Hi,
> 
> On Thu, 2009-05-21 at 13:27 -0300, Arnaldo Carvalho de Melo wrote:
> > Em Thu, May 21, 2009 at 08:10:00PM +0400, Evgeniy Polyakov escreveu:
> > > Hi Arnaldo.
> > > 
> > > On Wed, May 20, 2009 at 08:06:52PM -0300, Arnaldo Carvalho de Melo (acme@redhat.com) wrote:
> > > > Meaning receive multiple messages, reducing the number of syscalls and
> > > > net stack entry/exit operations.
> > > > 
> > > > Next patches will introduce mechanisms where protocols that want to
> > > > optimize this operation will provide an unlocked_recvmsg operation.
> > >  
> > > What's the difference from the single msg with multiple iovecs?
> > 
> > recvmsg consumes just one skb, a datagram, truncating if it has more
> > bytes than asked and giving less bytes than asked for if the skb being
> > consumer is smaller than requested.
> > 
> > WRT iovec, it gets this skb/datagram and goes on filling iovec entry by
> > entry, till it exhausts the skb.
> > 
> > The usecase here is: UDP socket has multiple skbs in its receive queue,
> > so application will make several syscalls to get those skbs while we
> > could return multiple datagrams in just one syscall + fd lookup + LSM
> > validation + lock_sock + release_sock.
> > 
> Its not just UDP/SOCK_DGRAM either. SOCK_SEQPACKET has to return after
> each message because it is not allowed to (nor can it, given the api)
> return more than one message in a single call. So with small messages
> that can add up to a lot of calls. This way the MSG_EOR flags can be
> preserved in the correct places,

Yeah, SOCK_SEQPACKET are just not optimized in the current patch, it
could, just providing a sk_prot->unlocked_recvmsg call, etc.

And to use sock_common_recvmsg in its socket->ops, which not all
protocol families do, but was my plan long ago to make all use so that
we could shorten the path, etc :-)

- Arnaldo

  reply	other threads:[~2009-05-21 16:46 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-20 23:06 [RFC 1/2] net: Introduce recvmmsg socket syscall Arnaldo Carvalho de Melo
2009-05-21  0:46 ` Neil Horman
2009-05-21  2:05   ` Arnaldo Carvalho de Melo
2009-05-21  2:26     ` Neil Horman
2009-05-21  3:50       ` David Miller
2009-05-21 10:40         ` Neil Horman
2009-05-21 14:16 ` Paul Moore
2009-05-21 14:47   ` Arnaldo Carvalho de Melo
2009-05-21 15:03     ` Paul Moore
2009-05-21 15:11       ` Arnaldo Carvalho de Melo
2009-05-21 15:24         ` Paul Moore
2009-05-21 16:10 ` Evgeniy Polyakov
2009-05-21 16:27   ` Arnaldo Carvalho de Melo
2009-05-21 16:33     ` Steven Whitehouse
2009-05-21 16:45       ` Arnaldo Carvalho de Melo [this message]
2009-05-21 16:38 ` Caitlin Bestler
2009-05-21 16:55   ` Arnaldo Carvalho de Melo
2009-05-21 17:26     ` Caitlin Bestler
2009-05-21 17:51       ` Arnaldo Carvalho de Melo
2009-05-22  8:32         ` steve
2009-05-22  7:22 ` Rémi Denis-Courmont
2009-05-22  8:31   ` steve
2009-05-22 16:39   ` Caitlin Bestler
2009-05-22 20:06 ` Neil Horman
2009-06-04  1:44   ` Andrew Grover
2009-06-04  1:46     ` Arnaldo Carvalho de Melo
2009-06-04 10:47     ` Neil Horman

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=20090521164545.GJ5956@ghostprotocols.net \
    --to=acme@redhat.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=steve@chygwyn.com \
    --cc=vanhoof@redhat.com \
    --cc=williams@redhat.com \
    --cc=zbr@ioremap.net \
    /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;
as well as URLs for NNTP newsgroup(s).