From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: recvmsg sleeping from invalid context Date: Sat, 14 Jan 2012 23:16:02 +0100 Message-ID: <1326579362.5287.45.camel@edumazet-laptop> References: <20120113182401.GA25885@redhat.com> <20120113.102712.600185688659703015.davem@davemloft.net> <20120114214334.GA28423@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: David Miller , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, glommer@parallels.com To: Dave Jones Return-path: In-Reply-To: <20120114214334.GA28423@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Le samedi 14 janvier 2012 =C3=A0 16:43 -0500, Dave Jones a =C3=A9crit : > On Fri, Jan 13, 2012 at 10:27:12AM -0800, David Miller wrote: > > From: Dave Jones > > Date: Fri, 13 Jan 2012 13:24:01 -0500 > >=20 > > > getting a ton of these on the latest head (099469502f62fbe0d7e4f= 0b83a2f22538367f734) > > >=20 > > > BUG: sleeping function called from invalid context at mm/memory.= c:3905 > > > in_atomic(): 0, irqs_disabled(): 0, pid: 1067, name: NetworkMana= ger > > > INFO: lockdep is turned off. > > > Pid: 1067, comm: NetworkManager Not tainted 3.2.0+ #22 > > > Call Trace: > > > [] __might_sleep+0x145/0x200 > > > [] might_fault+0x34/0xb0 > > > [] ? sock_def_readable+0x25/0x1a0 > > > [] put_cmsg+0x77/0x120 > > > [] netlink_recvmsg+0x35c/0x480 > > > [] ? sock_update_classid+0x9a/0x260 > > > [] ? sock_update_classid+0xd2/0x260 > > > [] sock_recvmsg+0x11d/0x140 > > > [] ? might_fault+0x53/0xb0 > > > [] ? might_fault+0x9c/0xb0 > > > [] ? might_fault+0x53/0xb0 > > > [] __sys_recvmsg+0x153/0x2d0 > > > [] ? fget_light+0x5a/0x470 > > > [] ? get_parent_ip+0x11/0x50 > > > [] ? sub_preempt_count+0x9d/0xd0 > > > [] ? fget_light+0xfb/0x470 > > > [] ? fget_light+0x5a/0x470 > > > [] sys_recvmsg+0x49/0x90 > > > [] system_call_fastpath+0x16/0x1b > >=20 > > Sigh, I suspect the new socket memcg code, which I didn't want to > > even apply in the first place. :-/ > >=20 > > Glauber, please fix this. >=20 > How new is 'new' ? >=20 > interestingly, I now started getting these in 3.1.9 where I never not= iced them before. >=20 >=20 > BUG: sleeping function called from invalid context at mm/memory.c:390= 5 > in_atomic(): 1, irqs_disabled(): 0, pid: 962, name: NetworkManager > 1 lock held by NetworkManager/962: > #0: (rcu_read_lock){.+.+..}, at: [] inet6_dump_fi= b+0x3d/0x3d0 > Pid: 962, comm: NetworkManager Not tainted 3.1.9-1.fc16.x86_64.debug = #1 > Call Trace: > [] __might_sleep+0xf0/0x120 > [] might_fault+0x38/0xb0 > [] ? sock_def_error_report+0x120/0x120 > [] put_cmsg+0x77/0x120 > [] netlink_recvmsg+0x35c/0x480 > [] ? sock_update_classid+0x8e/0x190 > [] ? sock_update_classid+0xc8/0x190 > [] sock_recvmsg+0x11d/0x140 > [] ? might_fault+0x5c/0xb0 > [] ? might_fault+0xa5/0xb0 > [] ? might_fault+0x5c/0xb0 > [] __sys_recvmsg+0x153/0x2d0 > [] ? sched_clock_cpu+0xa8/0x110 > [] ? trace_hardirqs_off+0xd/0x10 > [] ? local_clock+0x6f/0x80 > [] ? lock_release_holdtime.part.9+0x15/0x1a0 > [] ? fget_light+0xcf/0x3b0 > [] ? fget_light+0xe7/0x3b0 > [] ? fget_light+0x48/0x3b0 > [] sys_recvmsg+0x49/0x90 > [] system_call_fastpath+0x16/0x1b >=20 I dont understand this trace. inet6_dump_fib() does indeed an rcu_read_lock(), but pair it by rcu_read_unlock(). fib6_dump_table() is called with rcu_read_lock(), but certainly cannot end calling pu_cmsg().