Netdev List
 help / color / mirror / Atom feed
From: Edward Cree <ecree@solarflare.com>
To: Eric Dumazet <eric.dumazet@gmail.com>,
	Paolo Abeni <pabeni@redhat.com>,
	David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>
Subject: Re: [RFC PATCH net-next 0/3] net: batched receive in GRO path
Date: Tue, 30 Jul 2019 21:02:28 +0100	[thread overview]
Message-ID: <d7e1665f-807d-e5a7-01a5-ee411e4b967a@solarflare.com> (raw)
In-Reply-To: <a30137b4-1b01-df6e-c771-c5ddd1cfc490@solarflare.com>

On 24/07/2019 22:49, Edward Cree wrote:
> One thing that's causing me some uncertainty: busy_poll_stop() does a
>  napi->poll(), which can potentially gro_normal_one() something.  But
>  when I tried to put a gro_normal_list() just after that, I ran into
>  list corruption because it could race against the one in
>  napi_complete_done().
Turns out that the bh_disables are a red herring, we're racing against a
 napi poll on a different CPU.
I *think* that the sequence of events is
- enter busy_poll_stop
- enter napi->poll
- napi->poll calls napi_complete_done(), which schedules a new napi
- that new napi runs, on another CPU
- meanwhile, busy_poll_stop returns from napi->poll; if it then does a
  gro_normal_list it can race with the one on the other CPU from the new
  napi-poll.
Which means that...
> Questions that arise from that:
> 1) Is it safe to potentially be adding to the rx_list (gro_normal_one(),
>    which in theory can end up calling gro_normal_list() as well) within
>    busy_poll_stop()?  I haven't ever seen a splat from that, but it seems
>    every bit as possible as what I have been seeing.
... this isn't a problem, because napi->poll() will do all of its
 gro_normal_one()s before it calls napi_complete_done().

Just gathering some final performance numbers, then I'll post the updated
 patches (hopefully) later tonight.

-Ed

      reply	other threads:[~2019-07-30 20:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-09 19:27 [RFC PATCH net-next 0/3] net: batched receive in GRO path Edward Cree
2019-07-09 19:28 ` [RFC PATCH net-next 1/3] sfc: don't score irq moderation points for GRO Edward Cree
2019-07-09 19:29 ` [RFC PATCH net-next 2/3] sfc: falcon: " Edward Cree
2019-07-09 19:29 ` [RFC PATCH net-next 3/3] net: use listified RX for handling GRO_NORMAL skbs Edward Cree
2019-07-10  7:27 ` [RFC PATCH net-next 0/3] net: batched receive in GRO path Paolo Abeni
2019-07-10 14:52   ` Edward Cree
2019-07-10 15:41     ` Eric Dumazet
2019-07-10 16:47       ` Edward Cree
2019-07-10 17:39         ` Eric Dumazet
2019-07-12 15:59           ` Edward Cree
2019-07-12 16:48             ` Eric Dumazet
2019-07-12 18:30               ` David Miller
2019-07-24 21:49               ` Edward Cree
2019-07-30 20:02                 ` Edward Cree [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:
  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=d7e1665f-807d-e5a7-01a5-ee411e4b967a@solarflare.com \
    --to=ecree@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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