[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090731180921.GA24491@hmsreliant.think-freely.org>
Date: Fri, 31 Jul 2009 14:09:21 -0400
From: Neil Horman <nhorman@...driver.com>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: Matt Mackall <mpm@...enic.com>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
Matt Carlson <mcarlson@...adcom.com>
Subject: Re: netpoll + xmit_lock == deadlock
On Fri, Jul 31, 2009 at 09:02:43PM +0800, Herbert Xu wrote:
> On Fri, Jul 31, 2009 at 08:56:54AM -0400, Neil Horman wrote:
> >
> > > tg3_poll => tg3_poll_work => tg3_tx => netif_tx_lock
> >
> > Oh, goodness, thats just asking for disaster. Setting asside the netpoll issue
> > for the moment, what if we take an rx interrupt on a cpu while in the middle of
> > sending a frame? Whats to stop the NET_RX_SOFTIRQ after the hard interrupt and
> > recursively taking the _xmit_lock? With or without netpoll, that seems prone to
> > deadlock.
>
> No that can't happen because BH is disabled in the xmit function.
>
> This problem is specific to netpoll because it does things that
> normally can't happen with BH off.
>
Ugh, you're right, my bad.
In fact, looking back, we had a similar problem (but not identical) in RHEL, in
which the netpoll path was removing the device from the poll_list from a
different cpu, leading to a double free. I fixed it by adding a state bit to
the napi flags that let helper functions know that we were in a netpoll context,
which let us avoid doing stupid things. Perhaps such a solution might be
usefull here. Set the flag when calling the poll routine from a netpoll
context, so napi_tx_lock, would know to do a trylock and always return success
or something of that nature.
I'd also be up for simply ripping out netpoll entirely..... ;)
Neil
> Cheers,
> --
> Visit Openswan at http://www.openswan.org/
> Email: Herbert Xu ~{PmV>HI~} <herbert@...dor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists