[NET]: Fix busy waiting in dev_close().
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>
This commit is contained in:
@@ -901,8 +901,7 @@ int dev_close(struct net_device *dev)
|
|||||||
smp_mb__after_clear_bit(); /* Commit netif_running(). */
|
smp_mb__after_clear_bit(); /* Commit netif_running(). */
|
||||||
while (test_bit(__LINK_STATE_RX_SCHED, &dev->state)) {
|
while (test_bit(__LINK_STATE_RX_SCHED, &dev->state)) {
|
||||||
/* No hurry. */
|
/* No hurry. */
|
||||||
current->state = TASK_INTERRUPTIBLE;
|
msleep(1);
|
||||||
schedule_timeout(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user