[NET]: Fix busy waiting in dev_close().
authorDavid S. Miller <davem@davemloft.net>
Thu, 28 Jul 2005 19:12:58 +0000 (12:12 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Jul 2005 19:12:58 +0000 (12:12 -0700)
If the current task has signal_pending(), the loop we have
to wait for the __LINK_STATE_RX_SCHED bit to clear becomes
a pure busy-loop.

Fixed by using msleep() instead of the hand-crafted version.

Noticed by Andrew Morton.

Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c

index ff9dc029233a850cfa3985525c89d1da761601f8..52a3bf7ae177a803b5b77190ec1f34e8070175e5 100644 (file)
@@ -901,8 +901,7 @@ int dev_close(struct net_device *dev)
        smp_mb__after_clear_bit(); /* Commit netif_running(). */
        while (test_bit(__LINK_STATE_RX_SCHED, &dev->state)) {
                /* No hurry. */
-               current->state = TASK_INTERRUPTIBLE;
-               schedule_timeout(1);
+               msleep(1);
        }
 
        /*