From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Dichtel Subject: Re: BUG: scheduling while atomic dev_set_promiscuity->__dev_notify_flags Date: Tue, 22 Oct 2013 13:52:05 +0200 Message-ID: <526666E5.3030202@6wind.com> References: Reply-To: nicolas.dichtel@6wind.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: netdev@vger.kernel.org To: Alexei Starovoitov Return-path: Received: from mail-wi0-f176.google.com ([209.85.212.176]:37924 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751950Ab3JVLwK (ORCPT ); Tue, 22 Oct 2013 07:52:10 -0400 Received: by mail-wi0-f176.google.com with SMTP id l12so5443164wiv.9 for ; Tue, 22 Oct 2013 04:52:09 -0700 (PDT) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Le 22/10/2013 03:04, Alexei Starovoitov a =E9crit : > Hi Nicolas, > > after commit 991fb3f74c "dev: always advertise rx_flags changes via n= etlink" > I'm seeing 'sleeping in atomic' bug. > > Steps to reproduce: > ip tuntap add dev tap1 mode tap > ifconfig tap1 up > tcpdump -nei tap1 > and in different terminal: > ip tuntap del dev tap1 mode tap > > [ 271.627994] device tap1 left promiscuous mode > [ 271.639897] BUG: sleeping function called from invalid context at > mm/slub.c:940 > [ 271.664491] in_atomic(): 1, irqs_disabled(): 0, pid: 3394, name: i= p > [ 271.677525] INFO: lockdep is turned off. > [ 271.690503] CPU: 0 PID: 3394 Comm: ip Tainted: G W 3.12.= 0-rc3+ #73 > [ 271.703996] Hardware name: System manufacturer System Product > Name/P8Z77 WS, BIOS 3007 07/26/2012 > [ 271.731254] ffffffff81a58506 ffff8807f0d57a58 ffffffff817544e5 > ffff88082fa0f428 > [ 271.760261] ffff8808071f5f40 ffff8807f0d57a88 ffffffff8108bad1 > ffffffff81110ff8 > [ 271.790683] 0000000000000010 00000000000000d0 00000000000000d0 > ffff8807f0d57af8 > [ 271.822332] Call Trace: > [ 271.838234] [] dump_stack+0x55/0x76 > [ 271.854446] [] __might_sleep+0x181/0x240 > [ 271.870836] [] ? rcu_irq_exit+0x68/0xb0 > [ 271.887076] [] kmem_cache_alloc_node+0x4e/0x2a0 > [ 271.903368] [] ? vprintk_emit+0x1dc/0x5a0 > [ 271.919716] [] ? __alloc_skb+0x57/0x2a0 > [ 271.936088] [] ? vprintk_emit+0x1e0/0x5a0 > [ 271.952504] [] __alloc_skb+0x57/0x2a0 > [ 271.968902] [] rtmsg_ifinfo+0x52/0x100 > [ 271.985302] [] __dev_notify_flags+0xad/0xc0 > [ 272.001642] [] __dev_set_promiscuity+0x8c/0x1c0 > [ 272.017917] [] ? packet_notifier+0x5/0x380 > [ 272.033961] [] dev_set_promiscuity+0x29/0x50 > [ 272.049855] [] packet_dev_mc+0x87/0xc0 > [ 272.065494] [] packet_notifier+0x1b2/0x380 > [ 272.080915] [] ? packet_notifier+0x5/0x380 > [ 272.096009] [] notifier_call_chain+0x66/0x150 > [ 272.110803] [] __raw_notifier_call_chain+0xe/0x= 10 > [ 272.125468] [] raw_notifier_call_chain+0x16/0x2= 0 > [ 272.139984] [] call_netdevice_notifiers_info+0x= 40/0x70 > [ 272.154523] [] call_netdevice_notifiers+0x16/0x= 20 > [ 272.168552] [] rollback_registered_many+0x145/0= x240 > [ 272.182263] [] rollback_registered+0x31/0x40 > [ 272.195369] [] unregister_netdevice_queue+0x58/= 0x90 > [ 272.208230] [] __tun_detach+0x140/0x340 > [ 272.220686] [] tun_chr_close+0x36/0x60 > > packet_notifier() does rcu_read_lock() before calling into packet_dev= _mc() . > > Not sure how to fix it cleanly, other than disabling a notify here. > Any suggestion? I don't reproduce it. Can you send me your .config? I will look more deeply at the code. Regards, Nicolas