linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Eric Dumazet' <eric.dumazet@gmail.com>,
	network dev <netdev@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: recvfrom/recvmsg performance and CONFIG_HARDENED_USERCOPY
Date: Mon, 9 Dec 2019 11:01:30 +0000	[thread overview]
Message-ID: <efffc167eff1475f94f745f733171d59@AcuMS.aculab.com> (raw)
In-Reply-To: <dc10298d-4280-b9b4-9203-be4000e85c42@gmail.com>

From: Eric Dumazet
> Sent: 06 December 2019 14:22
...
> Real question is : Do you actually need to use recvmsg() instead of recvfrom() ?
> If recvmsg() provides additional cmsg, this is not surprising it is more expensive.

Except I'm not passing in a buffer for it.
The reason I'm looking at recvmsg is that I'd like to use recvmmsg it order to
read out more than one message from a socket without doing an extra poll().
Note that I don't expect there to be a second message most of the time and
almost never a third one.

Although I think that will only ever 'win' if recvmmsg() called vfs_poll() to find
if there was more data to read before doing any of the copy_from_user() etc.

> recvmsg() also uses an indirect call, so CONFIG_RETPOLINE=y is probably hurting.

I don't have CONFIG_RETPOLINE enabled, the compiler I'm using is too old.
(gcc 4.7.3).

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

  parent reply	other threads:[~2019-12-09 11:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-06 13:39 recvfrom/recvmsg performance and CONFIG_HARDENED_USERCOPY David Laight
2019-12-06 14:21 ` Eric Dumazet
2019-12-06 16:09   ` Paolo Abeni
2019-12-06 16:19     ` Eric Dumazet
2019-12-09 11:01   ` David Laight [this message]
2019-12-09 18:43     ` Andy Lutomirski
2019-12-10 10:21       ` David Laight
2019-12-09 15:05 ` David Laight

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=efffc167eff1475f94f745f733171d59@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=x86@kernel.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;
as well as URLs for NNTP newsgroup(s).