提交 cfb0c089 编写于 作者: A Allan Stephens 提交者: David S. Miller

[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: NAllan Stephens <allan.stephens@windriver.com>
Signed-off-by: NPer Liden <per.liden@ericsson.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e91ed0bc
......@@ -1208,7 +1208,8 @@ static u32 dispatch(struct tipc_port *tport, struct sk_buff *buf)
atomic_inc(&tipc_queue_size);
skb_queue_tail(&sock->sk->sk_receive_queue, buf);
wake_up_interruptible(sock->sk->sk_sleep);
if (waitqueue_active(sock->sk->sk_sleep))
wake_up_interruptible(sock->sk->sk_sleep);
return TIPC_OK;
}
......@@ -1223,7 +1224,8 @@ static void wakeupdispatch(struct tipc_port *tport)
{
struct tipc_sock *tsock = (struct tipc_sock *)tport->usr_handle;
wake_up_interruptible(tsock->sk.sk_sleep);
if (waitqueue_active(tsock->sk.sk_sleep))
wake_up_interruptible(tsock->sk.sk_sleep);
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册