]> git.baikalelectronics.ru Git - kernel.git/commit
unix: use wq_has_sleeper in unix_dgram_recvmsg
authorRainer Weikusat <rweikusat@mobileactivedefense.com>
Thu, 26 Nov 2015 19:23:15 +0000 (19:23 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Dec 2015 19:57:43 +0000 (14:57 -0500)
commit2f640bdb477e7dcbf3b0c4c292e2fb69be3fe284
treec16747ed0980aa1f8542745a3111bc5ed09f18b1
parent5695277cbb3933d60b2a830a8783a8550e52952d
unix: use wq_has_sleeper in unix_dgram_recvmsg

The current unix_dgram_recvmsg does a wake up for every received
datagram. This seems wasteful as only SOCK_DGRAM client sockets in an
n:1 association with a server socket will ever wait because of the
associated condition. The patch below changes the function such that the
wake up only happens if wq_has_sleeper indicates that someone actually
wants to be notified. Testing with SOCK_SEQPACKET and SOCK_DGRAM socket
seems to confirm that this is an improvment.

Signed-Off-By: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/unix/af_unix.c