From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cong Wang Subject: Re: [PATCH net-next 03/10] vxlan: move IGMP join/leave to work queue Date: Wed, 5 Jun 2013 06:47:52 +0000 (UTC) Message-ID: References: <1370406254-6341-1-git-send-email-stephen@networkplumber.org> <1370406254-6341-3-git-send-email-stephen@networkplumber.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: netdev@vger.kernel.org Return-path: Received: from plane.gmane.org ([80.91.229.3]:53211 "EHLO plane.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752607Ab3FEGsM (ORCPT ); Wed, 5 Jun 2013 02:48:12 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Uk7Vw-0001dZ-8f for netdev@vger.kernel.org; Wed, 05 Jun 2013 08:48:08 +0200 Received: from 60.160.70.221 ([60.160.70.221]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Jun 2013 08:48:08 +0200 Received: from xiyou.wangcong by 60.160.70.221 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Jun 2013 08:48:08 +0200 Sender: netdev-owner@vger.kernel.org List-ID: On Wed, 05 Jun 2013 at 04:24 GMT, Stephen Hemminger 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 [ 55.013309] task: ffff880070eac900 ti: ffff8800716d4000 task.ti: ffff8800716d4000 [ 55.013309] RIP: 0010:[] [] vxlan_sock_release+0x25/0x55 [ 55.013309] RSP: 0018:ffff8800716d5cf8 EFLAGS: 00010246 [ 55.013309] RAX: 0000000000000000 RBX: ffff88006fd7c000 RCX: 0000000ccee84d06 [ 55.013309] RDX: dead000000200200 RSI: ffff880070ead048 RDI: ffff88006fd7c070 [ 55.013309] RBP: ffff8800716d5d08 R08: 0000000000000000 R09: ffff8800716d5c48 [ 55.013309] R10: 000000000000b6c4 R11: 000000000000b163 R12: ffff88006ebb7400 [ 55.013309] R13: ffff88006fd7c000 R14: ffff8800723b4520 R15: 0000000000000000 [ 55.013309] FS: 0000000000000000(0000) GS:ffff88007f800000(0000) knlGS:0000000000000000 [ 55.013309] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 55.013309] CR2: 00007fa99dc0a000 CR3: 0000000070c17000 CR4: 00000000000006e0 [ 55.013309] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 55.013309] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [ 55.013309] Stack: [ 55.013309] ffff880070eac900 ffff880070fc0b58 ffff8800716d5d48 ffffffff815e0a73 [ 55.013309] 080808e0716d5d28 0000000f00000000 ffff8800714ef008 ffff880070fc0b58 [ 55.013309] ffff88007f9d6200 ffff88007f9d38c0 ffff8800716d5de8 ffffffff8106872f [ 55.013309] Call Trace: [ 55.013309] [] vxlan_igmp_work+0xa8/0xcf [ 55.013309] [] process_one_work+0x240/0x408 [ 55.013309] [] ? process_one_work+0x173/0x408 [ 55.013309] [] worker_thread+0x15d/0x1f1 [ 55.013309] [] ? rescuer_thread+0x1ff/0x1ff [ 55.013309] [] kthread+0xb1/0xb9 [ 55.013309] [] ? freezing+0x17/0x17 [ 55.013309] [] ret_from_fork+0x7c/0xb0 [ 55.013309] [] ? freezing+0x17/0x17