From: David Miller <davem@davemloft.net>
To: mpm@selenic.com
Cc: bhutchings@solarflare.com, herbert@gondor.apana.org.au,
netdev@vger.kernel.org, mcarlson@broadcom.com
Subject: Re: netpoll + xmit_lock == deadlock
Date: Mon, 03 Aug 2009 21:19:05 -0700 (PDT) [thread overview]
Message-ID: <20090803.211905.100178246.davem@davemloft.net> (raw)
In-Reply-To: <1249329581.3703.122.camel@calx>
From: Matt Mackall <mpm@selenic.com>
Date: Mon, 03 Aug 2009 14:59:41 -0500
> First, I don't think we can solve the problem of 'reliably deliver
> printks inside the TX path'. If the driver needs to printk here, odds
> are good that sending isn't possible.
Agreed.
> So I think we should be clear up front that the solution we're looking
> for is 'don't crash the box when trying to printk from the tx path'.
>
> I think the most straightforward, driver-agnostic way to do this
> is to have netpoll wrap a driver's TX entrypoint such that recursion is
> disabled while in that path. This might actually simplify netpoll's
> internal locking ugliness. Something like:
>
> int netpoll_xmit_wrapper(struct sk_buff *skb, struct net_device *dev)
> {
> struct netpoll_info *npinfo = dev->npinfo;
> int ret;
>
> npinfo->recurse += 1; /* add appropriate locking */
> ret = npinfo->orig_tx(skb, dev);
> npinfo->recurse -= 1;
>
> return ret;
> }
Looks workable. Probably we even hold the netpoll lock here so
no additional protection would even be needed.
next prev parent reply other threads:[~2009-08-04 4:18 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-29 7:35 netpoll + xmit_lock == deadlock Herbert Xu
2009-07-29 19:07 ` Matt Mackall
2009-07-29 19:43 ` Neil Horman
2009-07-29 21:48 ` Matt Mackall
2009-07-29 23:15 ` Neil Horman
2009-07-29 23:17 ` Herbert Xu
2009-07-30 1:02 ` Neil Horman
2009-07-31 1:27 ` Herbert Xu
2009-07-29 22:38 ` Herbert Xu
2009-07-30 1:06 ` Neil Horman
2009-07-31 1:30 ` Herbert Xu
2009-07-31 12:56 ` Neil Horman
2009-07-31 13:02 ` Herbert Xu
2009-07-31 18:09 ` Neil Horman
2009-08-02 20:07 ` David Miller
2009-08-03 12:05 ` Ben Hutchings
2009-08-03 19:15 ` David Miller
2009-08-03 19:59 ` Matt Mackall
2009-08-04 4:19 ` David Miller [this message]
2009-08-04 6:48 ` Herbert Xu
2009-08-04 0:15 ` Herbert Xu
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=20090803.211905.100178246.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=bhutchings@solarflare.com \
--cc=herbert@gondor.apana.org.au \
--cc=mcarlson@broadcom.com \
--cc=mpm@selenic.com \
--cc=netdev@vger.kernel.org \
/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).