Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cfb0c089 authored by Allan Stephens's avatar Allan Stephens Committed by David S. Miller
Browse files

[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: default avatarAllan Stephens <allan.stephens@windriver.com>
Signed-off-by: default avatarPer Liden <per.liden@ericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e91ed0bc
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -1208,6 +1208,7 @@ static u32 dispatch(struct tipc_port *tport, struct sk_buff *buf)
	atomic_inc(&tipc_queue_size);
	atomic_inc(&tipc_queue_size);
	skb_queue_tail(&sock->sk->sk_receive_queue, buf);
	skb_queue_tail(&sock->sk->sk_receive_queue, buf);


	if (waitqueue_active(sock->sk->sk_sleep))
		wake_up_interruptible(sock->sk->sk_sleep);
		wake_up_interruptible(sock->sk->sk_sleep);
	return TIPC_OK;
	return TIPC_OK;
}
}
@@ -1223,6 +1224,7 @@ static void wakeupdispatch(struct tipc_port *tport)
{
{
	struct tipc_sock *tsock = (struct tipc_sock *)tport->usr_handle;
	struct tipc_sock *tsock = (struct tipc_sock *)tport->usr_handle;


	if (waitqueue_active(tsock->sk.sk_sleep))
		wake_up_interruptible(tsock->sk.sk_sleep);
		wake_up_interruptible(tsock->sk.sk_sleep);
}
}