netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: nhorman@tuxdriver.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] netpoll: fix race on poll_list resulting in garbage entry
Date: Tue, 09 Dec 2008 23:22:45 -0800 (PST)	[thread overview]
Message-ID: <20081209.232245.145580375.davem@davemloft.net> (raw)
In-Reply-To: <20081209210644.GC3785@hmsreliant.think-freely.org>

From: Neil Horman <nhorman@tuxdriver.com>
Date: Tue, 9 Dec 2008 16:06:44 -0500

> Hey all-
> 	A few months back a race was discused between the netpoll napi service
> path, and the fast path through net_rx_action:
> http://kerneltrap.org/mailarchive/linux-netdev/2007/10/16/345470
> 
> A patch was submitted for that bug, but I think we missed a case.
> 
> Consider the following scenario:
> 
> INITIAL STATE
> CPU0 has one napi_struct A on its poll_list
> CPU1 is calling netpoll_send_skb and needs to call poll_napi on the same
> napi_struct A that CPU0 has on its list
> 
> 
> 
> CPU0						CPU1
> net_rx_action					poll_napi
> !list_empty (returns true)			locks poll_lock for A
> 						 poll_one_napi
> 						  napi->poll
> 						   netif_rx_complete
> 						    __napi_complete
> 						    (removes A from poll_list)
> list_entry(list->next)
> 
 ...
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>

Looks good, applied.

Thanks Neil!

  reply	other threads:[~2008-12-10  7:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-09 21:06 [PATCH] netpoll: fix race on poll_list resulting in garbage entry Neil Horman
2008-12-10  7:22 ` David Miller [this message]
2008-12-11 13:07 ` Jarek Poplawski
2008-12-11 14:29   ` Neil Horman
2008-12-11 17:01   ` Stephen Hemminger
2008-12-11 18:15     ` Neil Horman
2008-12-12  0:03       ` Stephen Hemminger
2008-12-12 12:18         ` Neil Horman
2008-12-16 23:55           ` David Miller
2008-12-17 21:16             ` Neil Horman
2008-12-17 21:31               ` Stephen Hemminger
2008-12-17 23:44                 ` Neil Horman
2008-12-18  1:13                 ` Neil Horman
2008-12-18  3:29                   ` David Miller
2008-12-18 14:47                     ` Neil Horman
2008-12-18 19:52                     ` Neil Horman
2008-12-18 22:40                       ` Ben Hutchings
2008-12-18 23:30                         ` Johannes Berg
2008-12-19  1:25                         ` Neil Horman
2008-12-19  6:42                           ` David Miller
2008-12-19 13:42                             ` Neil Horman
2008-12-23  4:43                               ` David Miller
2008-12-18  9:04                   ` Jarek Poplawski
2008-12-12  7:07       ` Jarek Poplawski
2008-12-12 13:31         ` Neil Horman

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=20081209.232245.145580375.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.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).