archive mirror
 help / color / mirror / Atom feed
From: "Samudrala, Sridhar" <>
To: Cong Wang <>
Cc: Alexander Duyck <>,
	Eric Dumazet <>,
	Linux Kernel Network Developers <>
Subject: Re: Three questions about busy poll
Date: Fri, 22 Feb 2019 12:00:19 -0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On 2/15/2019 11:18 AM, Cong Wang wrote:
> On Thu, Feb 14, 2019 at 4:43 PM Samudrala, Sridhar
> <> wrote:
>> On 2/14/2019 12:15 PM, Cong Wang wrote:
>> Hello,
>> While looking into the busy polling in Linux kernel, three questions
>> come into my mind:
>> 1. In the document[1], it claims depends on
>> either SO_BUSY_POLL or 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?
>> epoll based busypoll is only based on global sysctl_net_busy_poll.
>> busy_poll value is used with poll()/select()/epoll and and busy_read is used
>> with socket recvmsg
> Right, I was confused by what the term "poll" refers to.
>> 2. Why there is no socket option for Clearly
>> sysctl_net_busy_poll is global and SO_BUSY_POLL only works for
>> Not sure if it is useful to make it a per socket option. I think it could
>> be a per poll/epoll fd option
> It is useful, however, from Willem's reply it looks like hard to push it
> down from epoll() interface to each socket.
>> 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?
>> A app can create one worker thread per device queue and a worker thread
>> for an incoming connection can be selected based on SO_INCOMING_NAPI_ID so that
>> all connections coming on a queue are processed by the same thread. This will
>> allow epoll from a thread to be associated with sockets that receive packets
>> from a single queue allowing busy polling.
> This information is very useful. It also requires each thread pinning to each
> CPU/RX queue, right?
Thread pinning will not be required if XPS is setup to use xps-rxqs that 
configuring symmetric queues so that tx-queue is selected based on rx-queue.
See XPS using receive queues map in Documentation/networking/scaling.txt
> Anyway, I will add this information to socket.7 man page.
> Thanks!

      reply	other threads:[~2019-02-22 20:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14 20:15 Cong Wang
2019-02-15  0:39 ` Willem de Bruijn
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] ` <>
2019-02-15 19:18   ` Cong Wang
2019-02-22 20:00     ` Samudrala, Sridhar [this message]

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \
    --subject='Re: Three questions about busy poll' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).