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, amwang@redhat.com, eric.dumazet@gmail.com
Subject: Re: [PATCH v2 1/2] netpoll: Fix __netpoll_rcu_free so that it can hold the rtnl lock
Date: Mon, 11 Feb 2013 19:19:45 -0500 (EST)	[thread overview]
Message-ID: <20130211.191945.29632365432532819.davem@davemloft.net> (raw)
In-Reply-To: <1360614331-29247-2-git-send-email-nhorman@tuxdriver.com>

From: Neil Horman <nhorman@tuxdriver.com>
Date: Mon, 11 Feb 2013 15:25:30 -0500

> __netpoll_rcu_free is used to free netpoll structures when the rtnl_lock is
> already held.  The mechanism is used to asynchronously call __netpoll_cleanup
> outside of the holding of the rtnl_lock, so as to avoid deadlock.
> Unfortunately, __netpoll_cleanup modifies pointers (dev->np), which means the
> rtnl_lock must be held while calling it.  Further, it cannot be held, because
> rcu callbacks may be issued in softirq contexts, which cannot sleep.
> 
> Fix this by converting the rcu callback to a work queue that is guaranteed to
> get scheduled in process context, so that we can hold the rtnl properly while
> calling __netpoll_cleanup
> 
> Tested successfully by myself.
> 
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>

Applied.

  reply	other threads:[~2013-02-12  0:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-07 14:56 [PATCH] netpoll: cleanup sparse warnings Neil Horman
2013-02-07 15:52 ` Eric Dumazet
2013-02-07 18:37   ` Neil Horman
2013-02-08  3:25     ` Eric Dumazet
2013-02-08 15:47       ` Neil Horman
2013-02-08 16:44         ` Eric Dumazet
2013-02-08 18:14           ` Neil Horman
2013-02-11 20:25 ` [PATCH v2 0/2] netpoll: Cleanup netpoll locking and " Neil Horman
2013-02-11 20:25   ` [PATCH v2 1/2] netpoll: Fix __netpoll_rcu_free so that it can hold the rtnl lock Neil Horman
2013-02-12  0:19     ` David Miller [this message]
2013-02-11 20:25   ` [PATCH v2 2/2] netpoll: cleanup sparse warnings Neil Horman
2013-02-12  0:19     ` David Miller
2013-02-11 21:11   ` [PATCH v2 0/2] netpoll: Cleanup netpoll locking and " David Miller
2013-02-11 21:51     ` 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=20130211.191945.29632365432532819.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=amwang@redhat.com \
    --cc=eric.dumazet@gmail.com \
    --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).