Skip to contentSkip to conversation

UEAGLE : use interruptible sleep

PATCH In review matthieu castet 1 participant 1 message Oct 3, 2006

Subsystems (3)
lore
Share & tools
lore

matthieu castet

author maintainer
#0 lore raw

PATCH 1/3 UEAGLE : use interruptible sleep

Hi,

this patch use wait_event_interruptible_timeout and msleep_interruptible beacause uninterruptible sleep (task state 'D') is counted as 1 towards load average, like running processes.

use *_interruptible :
Uninterruptible sleep (task state 'D') is counted as 1 towards load average, lik e running processes. Interruptible sleep is not.

drivers/usb/atm/ueagle-atm.c +3 -3
Index: linux/drivers/usb/atm/ueagle-atm.c
===================================================================
@@ -744,7 +744,7 @@
 
 static inline int wait_cmv_ack(struct uea_softc *sc)
 {
-	int ret = wait_event_timeout(sc->cmv_ack_wait,
+	int ret = wait_event_interruptible_timeout(sc->cmv_ack_wait,
 						   sc->cmv_ack, ACK_TIMEOUT);
 	sc->cmv_ack = 0;
 
@@ -1176,7 +1176,7 @@
 		if (!ret)
 			ret = uea_stat(sc);
 		if (ret != -EAGAIN)
-			msleep(1000);
+			msleep_interruptible(1000);
  		if (try_to_freeze())
 			uea_err(INS_TO_USBDEV(sc), "suspend/resume not supported, "
 				"please unplug/replug your modem\n");
@@ -1605,7 +1605,7 @@
 {
 	struct uea_softc *sc = usbatm->driver_data;
 
-	wait_event(sc->sync_q, IS_OPERATIONAL(sc));
+	wait_event_interruptible(sc->sync_q, IS_OPERATIONAL(sc));
 
 	return 0;