Skip to content

Commit

Permalink
[NET]: Fix busy waiting in dev_close().
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
davem330 committed Jul 28, 2005
1 parent 2ac6608 commit 6192b54
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down

0 comments on commit 6192b54

Please sign in to comment.