aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2006-10-17 00:47:18 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-10-18 22:55:17 -0400
commitcfb0c0890b200364c0886c0d9f0dc615f8114c43 (patch)
treed3dedd5c3fad9e2b6ee26b53b10fb0039416ec64 /net/tipc
parente91ed0bcdfc4812c0342d64281ee985213df07c3 (diff)
[TIPC]: Optimize wakeup logic when socket has no waiting processes
This patch adds a simple test so TIPC doesn't try waking up processes waiting on a socket if there are none waiting. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Per Liden <per.liden@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/socket.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index ed900fe96bdf..2a6a5a6b4c12 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1208,7 +1208,8 @@ static u32 dispatch(struct tipc_port *tport, struct sk_buff *buf)
1208 atomic_inc(&tipc_queue_size); 1208 atomic_inc(&tipc_queue_size);
1209 skb_queue_tail(&sock->sk->sk_receive_queue, buf); 1209 skb_queue_tail(&sock->sk->sk_receive_queue, buf);
1210 1210
1211 wake_up_interruptible(sock->sk->sk_sleep); 1211 if (waitqueue_active(sock->sk->sk_sleep))
1212 wake_up_interruptible(sock->sk->sk_sleep);
1212 return TIPC_OK; 1213 return TIPC_OK;
1213} 1214}
1214 1215
@@ -1223,7 +1224,8 @@ static void wakeupdispatch(struct tipc_port *tport)
1223{ 1224{
1224 struct tipc_sock *tsock = (struct tipc_sock *)tport->usr_handle; 1225 struct tipc_sock *tsock = (struct tipc_sock *)tport->usr_handle;
1225 1226
1226 wake_up_interruptible(tsock->sk.sk_sleep); 1227 if (waitqueue_active(tsock->sk.sk_sleep))
1228 wake_up_interruptible(tsock->sk.sk_sleep);
1227} 1229}
1228 1230
1229/** 1231/**