From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Alexander Duyck <alexander.duyck@gmail.com>,
Eric Dumazet <edumazet@google.com>,
sridhar.samudrala@intel.com,
Linux Kernel Network Developers <netdev@vger.kernel.org>
Subject: Re: Three questions about busy poll
Date: Thu, 14 Feb 2019 19:39:20 -0500 [thread overview]
Message-ID: <CA+FuTSdEhZ3GdODpvdkw8_icnTrawf45WNNtohHCkje4TpqD4g@mail.gmail.com> (raw)
In-Reply-To: <CAM_iQpX3fAHwX7u4Nne5zdjXXnMY=Y5HYde2rYGSHSQugqc_YQ@mail.gmail.com>
On Thu, Feb 14, 2019 at 3:15 PM Cong Wang <xiyou.wangcong@gmail.com> wrote:
>
> Hello,
>
> While looking into the busy polling in Linux kernel, three questions
> come into my mind:
>
> 1. In the document[1], it claims sysctl.net.busy_poll depends on
> either SO_BUSY_POLL or sysctl.net.busy_read. However, from the code in
> ep_set_busy_poll_napi_id(), I don't see such a dependency. It simply
> checks sysctl_net_busy_poll and sk->sk_napi_id, but sk->sk_napi_id is
> always set as long as we enable CONFIG_NET_RX_BUSY_POLL. So what I am
> missing here?
That documentation refers to sock_poll. This does call sk_busy_loop
individually on each socket in the pollset and thus respects those values.
Epoll was added later, after both sock_poll and that documentation.
> 2. Why there is no socket option for sysctl.net.busy_poll? Clearly
> sysctl_net_busy_poll is global and SO_BUSY_POLL only works for
> sysctl.net.busy_read.
I guess because of how sock_poll works. In that case it is not needed.
The poll duration applies more to the pollset than any of the
individual sockets, too.
> 3. How is SO_INCOMING_NAPI_ID supposed to be used? I can't find any
> useful documents online. Any example or more detailed doc?
From the commit message of 6d4339028b35 ("net: Introduce
SO_INCOMING_NAPI_ID") it sounds like a sharding mechanism that
maintains flow affinity by sharding based on rxqueue (assuming that
something like RSS was used to ensure flow affinity in the first
place).
next prev parent reply other threads:[~2019-02-15 0:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-14 20:15 Three questions about busy poll Cong Wang
2019-02-15 0:39 ` Willem de Bruijn [this message]
2019-02-15 19:04 ` Cong Wang
2019-02-15 22:46 ` Willem de Bruijn
2019-02-19 4:30 ` Cong Wang
2019-02-19 17:04 ` Willem de Bruijn
[not found] ` <bfaff1c6-1269-1c33-31e1-0a78f78d7214@intel.com>
2019-02-15 19:18 ` Cong Wang
2019-02-22 20:00 ` Samudrala, Sridhar
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=CA+FuTSdEhZ3GdODpvdkw8_icnTrawf45WNNtohHCkje4TpqD4g@mail.gmail.com \
--to=willemdebruijn.kernel@gmail.com \
--cc=alexander.duyck@gmail.com \
--cc=edumazet@google.com \
--cc=netdev@vger.kernel.org \
--cc=sridhar.samudrala@intel.com \
--cc=xiyou.wangcong@gmail.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;
as well as URLs for NNTP newsgroup(s).