Patchwork BUG: using smp_processor_id() in preemptible [00000000] code: avahi-daemon: caller is netif_rx

login
register
mail settings
Submitter Eric Dumazet
Date April 12, 2010, 7:40 p.m.
Message ID <1271101251.16881.135.camel@edumazet-laptop>
Download mbox | patch
Permalink /patch/49991/
State Superseded
Delegated to: David Miller
Headers show

Comments

Eric Dumazet - April 12, 2010, 7:40 p.m.
Le lundi 12 avril 2010 à 15:20 -0400, Eric Paris a écrit :
> I get about 9 of these near the start of the system while userspace is
> first coming up.  The  virtual machine in question is mostly Fedora 14
> with a kernel from linux-next as of today.  The hardware is RHEL 5.5
> with KVM:
> 
> tree: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> tag: next-20100412
> commit: bbeecf185fe464ccd7ee97ce6d3646ad686995b4
> 
> I'm not sure what else to collect, give, test, try, show, debug or what
> have you so let me know.  Attached is my full dmesg and config.
> 
> [   14.203970] BUG: using smp_processor_id() in preemptible [00000000] code: avahi-daemon/2093
> [   14.204025] caller is netif_rx+0xfa/0x110
> [   14.204032] Pid: 2093, comm: avahi-daemon Tainted: G        W  2.6.34-rc3-next-20100412+ #65
> [   14.204035] Call Trace:
> [   14.204064]  [<ffffffff81278fe5>] debug_smp_processor_id+0x105/0x110
> [   14.204070]  [<ffffffff8142163a>] netif_rx+0xfa/0x110
> [   14.204090]  [<ffffffff8145b631>] ip_dev_loopback_xmit+0x71/0xa0
> [   14.204095]  [<ffffffff8145b892>] ip_mc_output+0x192/0x2c0
> [   14.204099]  [<ffffffff8145d610>] ip_local_out+0x20/0x30
> [   14.204105]  [<ffffffff8145d8ad>] ip_push_pending_frames+0x28d/0x3d0
> [   14.204119]  [<ffffffff8147f1cc>] udp_push_pending_frames+0x14c/0x400
> [   14.204125]  [<ffffffff814803fc>] udp_sendmsg+0x39c/0x790
> [   14.204137]  [<ffffffff814891d5>] inet_sendmsg+0x45/0x80
> [   14.204149]  [<ffffffff8140af91>] sock_sendmsg+0xf1/0x110
> [   14.204177]  [<ffffffff810e3a89>] ? might_fault+0xb9/0xd0
> [   14.204184]  [<ffffffff810e3a3e>] ? might_fault+0x6e/0xd0
> [   14.204189]  [<ffffffff8140dc6c>] sys_sendmsg+0x20c/0x380
> [   14.204205]  [<ffffffff811107f1>] ? do_sync_write+0xd1/0x110
> [   14.204211]  [<ffffffff810e3a3e>] ? might_fault+0x6e/0xd0
> [   14.204233]  [<ffffffff8100ad82>] system_call_fastpath+0x16/0x1b

Good spot, RPS changed a bit netif_rx() requirements.

I would change ip_dev_loopback_xmit() to call netif_rx_ni() instead...

David, Tom ?




--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tom Herbert - April 12, 2010, 8:54 p.m.
> I would change ip_dev_loopback_xmit() to call netif_rx_ni() instead...
>
> David, Tom ?
>

Would it be better to disable preemption in netif_rx?  Also note that
with RFS we would be taking rcu_read_lock in netif_rx anyway and that
could cover all the instances of smp_processor_id().

> diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
> index c65f18e..d1bcc9f 100644
> --- a/net/ipv4/ip_output.c
> +++ b/net/ipv4/ip_output.c
> @@ -120,7 +120,7 @@ static int ip_dev_loopback_xmit(struct sk_buff *newskb)
>        newskb->pkt_type = PACKET_LOOPBACK;
>        newskb->ip_summed = CHECKSUM_UNNECESSARY;
>        WARN_ON(!skb_dst(newskb));
> -       netif_rx(newskb);
> +       netif_rx_ni(newskb);
>        return 0;
>  }
>
>
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index c65f18e..d1bcc9f 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -120,7 +120,7 @@  static int ip_dev_loopback_xmit(struct sk_buff *newskb)
 	newskb->pkt_type = PACKET_LOOPBACK;
 	newskb->ip_summed = CHECKSUM_UNNECESSARY;
 	WARN_ON(!skb_dst(newskb));
-	netif_rx(newskb);
+	netif_rx_ni(newskb);
 	return 0;
 }