netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Eric Dumazet <edumazet@google.com>
Cc: David Ahern <dsahern@gmail.com>,
	Stephen Hemminger <stephen@networkplumber.org>,
	netdev <netdev@vger.kernel.org>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Hangbin Liu <liuhangbin@gmail.com>
Subject: Re: [PATCH iproute2] lib/libnetlink: ensure a minimum of 32KB for the buffer used in rtnl_recvmsg()
Date: Wed, 13 Feb 2019 18:46:22 +0100	[thread overview]
Message-ID: <20190213174622.GD19329@orbyte.nwl.cc> (raw)
In-Reply-To: <20190213015841.140383-1-edumazet@google.com>

Hi Eric,

On Tue, Feb 12, 2019 at 05:58:41PM -0800, Eric Dumazet wrote:
> In the past, we tried to increase the buffer size up to 32 KB in order
> to reduce number of syscalls per dump.
> 
> Commit 2d34851cd341 ("lib/libnetlink: re malloc buff if size is not enough")
> brought the size back to 4KB because the kernel can not know the application
> is ready to receive bigger requests.
> 
> See kernel commits 9063e21fb026 ("netlink: autosize skb lengthes") and
> d35c99ff77ec ("netlink: do not enter direct reclaim from netlink_dump()")
> for more details.

Wouldn't it be better if the kernel recognized MSG_TRUNC and allocated a
buffer large enough to hold the full message in that case? I have no
idea how hard that would be to implement, but calling recvmsg() with
MSG_TRUNC set and not getting the full message length in return is not
quite what one expects after reading recvmsg(2).

Cheers, Phil

  parent reply	other threads:[~2019-02-13 17:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-13  1:58 [PATCH iproute2] lib/libnetlink: ensure a minimum of 32KB for the buffer used in rtnl_recvmsg() Eric Dumazet
2019-02-13  2:04 ` David Ahern
2019-02-13  2:08   ` Eric Dumazet
2019-02-13  6:20     ` Hangbin Liu
2019-02-14 13:51       ` Michal Kubecek
2019-02-14 13:49   ` Michal Kubecek
2019-02-14 17:34     ` David Ahern
2019-02-14 17:47       ` Phil Sutter
2023-05-29 12:29   ` Gal Pressman
2023-05-31 21:51     ` Stephen Hemminger
2023-06-04 13:33       ` Gal Pressman
2023-06-04 16:03         ` David Ahern
2023-06-05  7:24           ` Gal Pressman
2019-02-13 17:46 ` Phil Sutter [this message]
2019-02-13 17:58   ` Eric Dumazet
2019-02-13 21:57 ` Stephen Hemminger
2019-02-13 21:59   ` Eric Dumazet

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=20190213174622.GD19329@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --cc=dsahern@gmail.com \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.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).