All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <mike.rapoport@ravellosystems.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Cong Wang <xiyou.wangcong@gmail.com>, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 03/10] vxlan: move IGMP join/leave to work queue
Date: Sat, 8 Jun 2013 11:23:27 +0300	[thread overview]
Message-ID: <CAF1J0HN5k5=kJtcX_enDYBqnAf2HAH5s84nBOb9QjShWnvwmug@mail.gmail.com> (raw)
In-Reply-To: <20130605084116.4eb9dc94@nehalam.linuxnetplumber.net>

On Wed, Jun 5, 2013 at 6:41 PM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
> On Wed, 5 Jun 2013 10:29:10 +0300
> Mike Rapoport <mike.rapoport@ravellosystems.com> wrote:
>
>> On Wed, Jun 5, 2013 at 9:47 AM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
>> > On Wed, 05 Jun 2013 at 04:24 GMT, Stephen Hemminger <stephen@networkplumber.org> wrote:
>> >> Do join/leave from work queue to avoid lock inversion problems
>> >> between normal socket and RTNL. The code comes out cleaner
>> >> as well.
>> >>
>> >> Uses Cong Wang's suggestion to turn refcnt into a real atomic
>> >> since now need to handle case where last use of socket is IGMP
>> >> worker.
>> >>
>> >> Also fixes race where vxlan_stop could be called after
>> >> device was deleted on module removal. The call to rtnl_link_unregister
>> >> would call dellink while vxlan device was still up. Reordering
>> >> the calls fixes it.
>> >>
>> >
>> > After the first 3 patches applied, I got:
>> >
>> > [   55.010954] general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC
>> > [   55.013309] CPU: 1 PID: 163 Comm: kworker/1:2 Not tainted
>> > 3.10.0-rc2+ #1150
>> > [   55.013309] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
>> > [   55.013309] Workqueue: events vxlan_igmp_work
>>
>> I think the problem happens because vxlan_dellink does
>> unregister_netdevice_queue and then immediately calls
>> vxlan_sock_release and thus vs_sock is released before igmp_work
>> starts
>
> This is handled because a refcount is acquired before the igmp_work
> is scheduled.

As far as I can tell, the vxlan_sock_release in vxlan_dellink call
occurs before vxlan_stop is invoked, and therefore before refcount is
acquired for igmp_work.
When I tried to use unregister_netdevice_queue(dev, NULL) I haven't
seen crashes.


--
Sincerely yours,
Mike.

  reply	other threads:[~2013-06-08  8:23 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-05  4:24 [PATCH net-next 01/10] vxlan: only migrate dynamic FDB entries Stephen Hemminger
2013-06-05  4:24 ` [PATCH net-next 02/10] vxlan: handle skb_clone failure Stephen Hemminger
2013-06-05  6:59   ` Cong Wang
2013-06-05 14:05     ` David Stevens
2013-06-06  0:47       ` Cong Wang
2013-06-06  1:31         ` Stephen Hemminger
2013-06-05 12:50   ` David Stevens
2013-06-05  4:24 ` [PATCH net-next 03/10] vxlan: move IGMP join/leave to work queue Stephen Hemminger
2013-06-05  6:47   ` Cong Wang
2013-06-05  7:29     ` Mike Rapoport
2013-06-05  8:00       ` Cong Wang
2013-06-05 15:41       ` Stephen Hemminger
2013-06-08  8:23         ` Mike Rapoport [this message]
2013-06-05 15:42     ` Stephen Hemminger
2013-06-06  0:49       ` Cong Wang
2013-06-05 15:37   ` [PATCH net] vxlan: fix crash on module removal Stephen Hemminger
2013-06-06  1:11     ` Cong Wang
2013-06-06  1:32       ` Stephen Hemminger
2013-06-05  4:24 ` [PATCH net-next 04/10] vxlan: send notification when MAC migrates Stephen Hemminger
2013-06-05  4:24 ` [PATCH net-next 05/10] vxlan: make vxlan_xmit_one void Stephen Hemminger
2013-06-05 12:54   ` David Stevens
2013-06-05  4:24 ` [PATCH net-next 06/10] vxlan: convert remotes list to list_rcu Stephen Hemminger
2013-06-05  4:24 ` [PATCH net-next 07/10] vxlan: port module param should be ushort Stephen Hemminger
2013-06-05 13:35   ` Sergei Shtylyov
2013-06-05  4:24 ` [PATCH net-next 08/10] vxlan: use initializer for dummy structures Stephen Hemminger
2013-06-05  4:24 ` [PATCH net-next 09/10] vxlan: whitespace cleanup Stephen Hemminger
2013-06-05 12:55   ` David Stevens
2013-06-05  4:24 ` [PATCH net-next 10/10] vxlan: version 0.2 Stephen Hemminger
2013-06-05  6:23 ` [PATCH net-next 01/10] vxlan: only migrate dynamic FDB entries Cong Wang
2013-06-06 23:16 ` David Miller

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='CAF1J0HN5k5=kJtcX_enDYBqnAf2HAH5s84nBOb9QjShWnvwmug@mail.gmail.com' \
    --to=mike.rapoport@ravellosystems.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=xiyou.wangcong@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.