Skip to contentSkip to conversation

napi: use non-interruptible sleep in napi_disable

PATCH Applied Benjamin Herrenschmidt 3 participants 3 messages Oct 25, 2007 – Oct 26, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 napi: use non-interruptible sleep in napi_disable

The current napi_disable() uses msleep_interruptible() but doesn't (and can't) exit in case there's a signal, thus ending up doing a hot spin without a cpu_relax. Use uninterruptible sleep instead.

---

 include/linux/netdevice.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/netdevice.h +1 -1
Index: linux-work/include/linux/netdevice.h
===================================================================
@@ -390,7 +390,7 @@ static inline void napi_complete(struct 
 static inline void napi_disable(struct napi_struct *n)
 {
 	while (test_and_set_bit(NAPI_STATE_SCHED, &n->state))
-		msleep_interruptible(1);
+		msleep(1);
 }
 
 /**
#1 lore raw
Quoted 15 lines · Benjamin Herrenschmidt

The current napi_disable() uses msleep_interruptible() but doesn't (and can't) exit in case there's a signal, thus ending up doing a hot spin without a cpu_relax. Use uninterruptible sleep instead.

---

 include/linux/netdevice.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-work/include/linux/netdevice.h
===================================================================

include/linux/netdevice.h static inline void napi_complete(struct · line 394

Quoted 6 lines
include/linux/netdevice.h +1 -1
@@ -390,7 +390,7 @@ static inline void napi_complete(struct 
 static inline void napi_disable(struct napi_struct *n)
 {
 	while (test_and_set_bit(NAPI_STATE_SCHED, &n->state))
-		msleep_interruptible(1);
+		msleep(1);
 }

ACK

maintainer Applied
#2 lore raw

From: Jeff Garzik <[email protected]>
Date: Thu, 25 Oct 2007 01:10:32 -0400

Quoted 6 lines
Quoted 5 lines · Benjamin Herrenschmidt

The current napi_disable() uses msleep_interruptible() but doesn't (and can't) exit in case there's a signal, thus ending up doing a hot spin without a cpu_relax. Use uninterruptible sleep instead.

...

Quoted 1 line

ACK

Applied, thanks everyone.