From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?B?Ss61YW4=?= Sacren Subject: Re: [PATCH v2 net] net: do not use rcu in rtnl_dump_ifinfo() Date: Fri, 27 Feb 2015 17:43:57 -0700 Message-ID: <20150228004357.GA28631@mail.gmail.com> References: <1425018776-14725-1-git-send-email-xiyou.wangcong@gmail.com> <1425024069.5130.10.camel@edumazet-glaptop2.roam.corp.google.com> <54F09A95.8000507@6wind.com> <1425056838.5130.27.camel@edumazet-glaptop2.roam.corp.google.com> <1425058970.5130.32.camel@edumazet-glaptop2.roam.corp.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: nicolas.dichtel@6wind.com, Daniel Borkmann , David Miller , Cong Wang , netdev@vger.kernel.org To: Eric Dumazet Return-path: Received: from mail-ob0-f173.google.com ([209.85.214.173]:64965 "EHLO mail-ob0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751179AbbB1Aqu (ORCPT ); Fri, 27 Feb 2015 19:46:50 -0500 Received: by mail-ob0-f173.google.com with SMTP id uy5so21964968obc.4 for ; Fri, 27 Feb 2015 16:46:50 -0800 (PST) Content-Disposition: inline In-Reply-To: <1425058970.5130.32.camel@edumazet-glaptop2.roam.corp.google.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Eric Dumazet Date: Fri, 27 Feb 2015 09:42:50 -0800 > > From: Eric Dumazet > > We did a failed attempt in the past to only use rcu in rtnl dump > operations (commit e67f88dd12f6 "net: dont hold rtnl mutex during > netlink dump callbacks") > > Now that dumps are holding RTNL anyway, there is no need to also > use rcu locking, as it forbids any scheduling ability, like > GFP_KERNEL allocations that controlling path should use instead > of GFP_ATOMIC whenever possible. > > This should fix following splat Cong Wang reported : > > [ INFO: suspicious RCU usage. ] > 3.19.0+ #805 Tainted: G W > > include/linux/rcupdate.h:538 Illegal context switch in RCU read-side critical section! > > other info that might help us debug this: > > > rcu_scheduler_active = 1, debug_locks = 0 > 2 locks held by ip/771: > #0: (rtnl_mutex){+.+.+.}, at: [] netlink_dump+0x21/0x26c > #1: (rcu_read_lock){......}, at: [] rcu_read_lock+0x0/0x6e > > stack backtrace: > CPU: 3 PID: 771 Comm: ip Tainted: G W 3.19.0+ #805 > Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 > 0000000000000001 ffff8800d51e7718 ffffffff81a27457 0000000029e729e6 > ffff8800d6108000 ffff8800d51e7748 ffffffff810b539b ffffffff820013dd > 00000000000001c8 0000000000000000 ffff8800d7448088 ffff8800d51e7758 > Call Trace: > [] dump_stack+0x4c/0x65 > [] lockdep_rcu_suspicious+0x107/0x110 > [] rcu_preempt_sleep_check+0x45/0x47 > [] ___might_sleep+0x1d/0x1cb > [] __might_sleep+0x78/0x80 > [] idr_alloc+0x45/0xd1 > [] ? rcu_read_lock_held+0x3b/0x3d > [] ? idr_for_each+0x53/0x101 > [] alloc_netid+0x61/0x69 > [] __peernet2id+0x79/0x8d > [] peernet2id+0x13/0x1f > [] rtnl_fill_ifinfo+0xa8d/0xc20 > [] ? __lock_is_held+0x39/0x52 > [] rtnl_dump_ifinfo+0x149/0x213 > [] netlink_dump+0xef/0x26c > [] netlink_recvmsg+0x17b/0x2c5 > [] __sock_recvmsg+0x4e/0x59 > [] sock_recvmsg+0x3f/0x51 > [] ___sys_recvmsg+0xf6/0x1d9 > [] ? handle_pte_fault+0x6e1/0xd3d > [] ? native_sched_clock+0x35/0x37 > [] ? sched_clock_local+0x12/0x72 > [] ? sched_clock_cpu+0x9e/0xb7 > [] ? rcu_read_lock_held+0x3b/0x3d > [] ? __fcheck_files+0x4c/0x58 > [] ? __fget_light+0x2d/0x52 > [] __sys_recvmsg+0x42/0x60 > [] SyS_recvmsg+0x12/0x1c > > Signed-off-by: Eric Dumazet > Fixes: commit 0c7aecd4bde4b7302 ("netns: add rtnl cmd to add and get peer netns ids") - The word 'commit' is not supposed to be there. - ${SHA1} is supposed to be 12-digit-long.