netdev
[Top] [All Lists]

Re: Lockup with 2.6.9-ac15 related to netconsole

To: Matt Mackall <mpm@xxxxxxxxxxx>
Subject: Re: Lockup with 2.6.9-ac15 related to netconsole
From: Francois Romieu <romieu@xxxxxxxxxxxxx>
Date: Tue, 21 Dec 2004 23:58:31 +0100
Cc: Mark Broadbent <markb@xxxxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20041221212737.GK5974@xxxxxxxxx>
References: <20041217233524.GA11202@xxxxxxxxxxxxxxxxxxxxxxxxxx> <36901.192.102.214.6.1103535728.squirrel@xxxxxxxxxxxxxxxxxxxxxx> <20041220211419.GC5974@xxxxxxxxx> <20041221002218.GA1487@xxxxxxxxxxxxxxxxxxxxxxxxxx> <20041221005521.GD5974@xxxxxxxxx> <52121.192.102.214.6.1103624620.squirrel@xxxxxxxxxxxxxxxxxxxxxx> <20041221123727.GA13606@xxxxxxxxxxxxxxxxxxxxxxxxxx> <49295.192.102.214.6.1103635762.squirrel@xxxxxxxxxxxxxxxxxxxxxx> <20041221204853.GA20869@xxxxxxxxxxxxxxxxxxxxxxxxxx> <20041221212737.GK5974@xxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.1i
Matt Mackall <mpm@xxxxxxxxxxx> :
[...]
> I think it's the promiscuous mode message itself that's the problem

Yes. dev_mc_add takes dev->xmit_lock and the game is over.

Marc, if the patch below happens to work, it should not drop messages
like the previous one (it is an ugly short-term suggestion).

--- net/core/netpoll.c  2004-12-21 13:09:51.000000000 +0100
+++ net/core/netpoll.c  2004-12-21 23:35:25.000000000 +0100
@@ -22,6 +22,7 @@
 #include <net/tcp.h>
 #include <net/udp.h>
 #include <asm/unaligned.h>
+#include <net/pkt_sched.h>
 
 /*
  * We maintain a small pool of fully-sized skbs, to make sure the
@@ -184,11 +187,19 @@ void netpoll_send_skb(struct netpoll *np
 
 repeat:
        if(!np || !np->dev || !netif_running(np->dev)) {
                __kfree_skb(skb);
                return;
        }
 
-       spin_lock(&np->dev->xmit_lock);
+       while (!spin_trylock(&np->dev->xmit_lock)) {
+               if (np->dev->xmit_lock_owner == smp_processor_id()) {
+                       struct Qdisc *q = dev->qdisc;
+
+                       q->ops->enqueue(skb, q);
+                       return;
+               }
+       }
+
        np->dev->xmit_lock_owner = smp_processor_id();
 
        /*

<Prev in Thread] Current Thread [Next in Thread>