From mboxrd@z Thu Jan 1 00:00:00 1970 From: Or Gerlitz Subject: Re: [PATCH net-next V3 1/2] IB/ipoib: Add rtnl_link_ops support Date: Wed, 12 Sep 2012 13:40:11 +0300 Message-ID: <5050668B.1010105@mellanox.com> References: <1345724119-32110-1-git-send-email-ogerlitz@mellanox.com> <1345724119-32110-2-git-send-email-ogerlitz@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Cc: , Shlomo Pongratz To: Patrick McHardy , Eric Dumazet Return-path: Received: from eu1sys200aog117.obsmtp.com ([207.126.144.143]:50962 "HELO eu1sys200aog117.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1755891Ab2ILKoU (ORCPT ); Wed, 12 Sep 2012 06:44:20 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Patrick McHardy wrote: > Or Gerlitz wrote: > >> +#define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1) > > This should go into include/linux/if_link.h > This comment was easy to fix... HOWEVER, using V3 -- this posting http://marc.info/?l=linux-netdev&m=134572609226343&w=2 -- of the patch over latest net-next (commit 280050cc81ccb2e06e4061228ee34c0cc86b1560 "x86 bpf_jit: support MOD operation"), when I just run the following trivial sequence which loads the module and creates/deletes legacy child $ modprobe ib_ipoib debug_level=1 $ echo 0x8001 > /sys/class/net/ib0/create_child $ echo 0x8001 > /sys/class/net/ib0/delete_child $ modprobe -r ib_ipoib I get the below lockdep warning, pointing to ipoib_vlan_delete which is by not means called by the module unload sequence, confusing... any idea? Or. ====================================================== [ INFO: possible circular locking dependency detected ] 3.6.0-rc3+ #144 Not tainted ------------------------------------------------------- modprobe/4443 is trying to acquire lock: (s_active#155){++++.+}, at: [] sysfs_addrm_finish+0x29/0x52 but task is already holding lock: (rtnl_mutex){+.+.+.}, at: [] rtnl_lock+0x12/0x14 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (rtnl_mutex){+.+.+.}: [] lock_acquire+0x14f/0x19b [] mutex_lock_nested+0x64/0x2ce [] rtnl_lock+0x12/0x14 [] netdev_run_todo+0xa5/0x27e [] rtnl_unlock+0x9/0xb [] ipoib_vlan_delete+0x111/0x148 [ib_ipoib] [] delete_child+0x44/0x60 [ib_ipoib] [] dev_attr_store+0x1b/0x1d [] sysfs_write_file+0x103/0x13f [] vfs_write+0xae/0x133 [] sys_write+0x45/0x6c [] system_call_fastpath+0x16/0x1b -> #0 (s_active#155){++++.+}: [] __lock_acquire+0x10d1/0x174e [] lock_acquire+0x14f/0x19b [] sysfs_deactivate+0x93/0xca [] sysfs_addrm_finish+0x29/0x52 [] sysfs_remove_dir+0x8b/0x9e [] kobject_del+0x16/0x37 [] device_del+0x18f/0x19f [] netdev_unregister_kobject+0x52/0x57 [] rollback_registered_many+0x238/0x27c [] unregister_netdevice_queue+0x7f/0xbf [] unregister_netdev+0x1c/0x23 [] ipoib_remove_one+0xad/0xe7 [ib_ipoib] [] ib_unregister_client+0x3d/0x11c [ib_core] [] ipoib_cleanup_module+0x2f/0x4e [ib_ipoib] [] sys_delete_module+0x1ac/0x210 [] system_call_fastpath+0x16/0x1b other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(rtnl_mutex); lock(s_active#155); lock(rtnl_mutex); lock(s_active#155); *** DEADLOCK *** 2 locks held by modprobe/4443: #0: (device_mutex){+.+.+.}, at: [] ib_unregister_client+0x22/0x11c [ib_core] #1: (rtnl_mutex){+.+.+.}, at: [] rtnl_lock+0x12/0x14 stack backtrace: Pid: 4443, comm: modprobe Not tainted 3.6.0-rc3+ #144 Call Trace: [] ? console_unlock+0x329/0x37e [] print_circular_bug+0x28e/0x29f [] __lock_acquire+0x10d1/0x174e [] ? sysfs_addrm_finish+0x29/0x52 [] lock_acquire+0x14f/0x19b [] ? sysfs_addrm_finish+0x29/0x52 [] sysfs_deactivate+0x93/0xca [] ? sysfs_addrm_finish+0x29/0x52 [] sysfs_addrm_finish+0x29/0x52 [] sysfs_remove_dir+0x8b/0x9e [] kobject_del+0x16/0x37 [] device_del+0x18f/0x19f [] netdev_unregister_kobject+0x52/0x57 [] rollback_registered_many+0x238/0x27c [] unregister_netdevice_queue+0x7f/0xbf [] unregister_netdev+0x1c/0x23 [] ipoib_remove_one+0xad/0xe7 [ib_ipoib] [] ib_unregister_client+0x3d/0x11c [ib_core] [] ipoib_cleanup_module+0x2f/0x4e [ib_ipoib] [] sys_delete_module+0x1ac/0x210 [] ? trace_hardirqs_on_caller+0x11e/0x155 [] ? trace_hardirqs_on_thunk+0x3a/0x3f [] system_call_fastpath+0x16/0x1b