Subject: Re: netpoll + xmit_lock == deadlock

From: Ben Hutchings <[email-masked]>
Date: Mon, 03 Aug 2009 13:05:57 +0100

On Sun, 2009-08-02 at 13:07 -0700, David Miller wrote:
> From: Herbert Xu <[email-masked]>
> Date: Wed, 29 Jul 2009 15:35:23 +0800
> 
> > So if a driver is in the TX path, and a printk occurs, then a
> > recursive dead lock can occur if that driver tries to take the
> > xmit lock in its poll function to clean up descriptors.
> 
> My position has always been that such printk's are simply
> not allowed.  (check archives if you don't believe me :-)
>
> The locking is going to get rediculious if we start having
> to account for this.

I agree with that, but this does seem quite restrictive.  How can we be
sure that none of the kernel functions used by a driver's TX path (e.g.
kmalloc or DMA-mapping) will print debug or warning messages?  If such
guarantees exist, they do not seem to be documented.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.