tree b78a56cb70fe36f145821ac3c699abf3dc627256
parent 2ac6608c41f8c45371ea9dddae7f99bc2c15d5cf
author David S. Miller <[EMAIL PROTECTED]> Fri, 29 Jul 2005 02:12:58 -0700
committer David S. Miller <[EMAIL PROTECTED]> Fri, 29 Jul 2005 02:12:58 -0700
[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 <[EMAIL PROTECTED]>
net/core/dev.c | 3 +--
1 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -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);
}
/*
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html