netdev
[Top] [All Lists]

Re: [2.6.5] Bad scheduling while atomic

To: "David S. Miller" <davem@xxxxxxxxxx>
Subject: Re: [2.6.5] Bad scheduling while atomic
From: Stephen Hemminger <shemminger@xxxxxxxx>
Date: Fri, 16 Apr 2004 13:16:33 -0700
Cc: "Paul Rolland" <rol@xxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <200404161551.i3GFpD124970@tag.witbe.net>
Organization: Open Source Development Lab
References: <200404161551.i3GFpD124970@tag.witbe.net>
Sender: netdev-bounce@xxxxxxxxxxx
Bring up/down network devices with lapbether causes scheduling while
atomic (if preempt enabled).

The calls to rcu_read_lock are unnecessary since lapb_device_event 
is called from notifier with the rtnetlink semaphore held, it is
already protected from the labp_devices list changing.

Patch against 2.6.6-rc1

diff -Nru a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
--- a/drivers/net/wan/lapbether.c       Fri Apr 16 11:00:35 2004
+++ b/drivers/net/wan/lapbether.c       Fri Apr 16 11:00:35 2004
@@ -392,6 +392,8 @@
 
 /*
  *     Handle device status changes.
+ *
+ * Called from notifier with RTNL held.
  */
 static int lapbeth_device_event(struct notifier_block *this,
                                unsigned long event, void *ptr)
@@ -402,7 +404,6 @@
        if (!dev_is_ethdev(dev))
                return NOTIFY_DONE;
 
-       rcu_read_lock();
        switch (event) {
        case NETDEV_UP:
                /* New ethernet device -> new LAPB interface     */
@@ -422,7 +423,6 @@
                        lapbeth_free_device(lapbeth);
                break;
        }
-       rcu_read_unlock();
 
        return NOTIFY_DONE;
 }

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