diff options
| author | Eric Dumazet <[email protected]> | 2010-10-29 20:44:44 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2010-11-08 21:50:08 +0000 |
| commit | 67426b756c4d52c511c4b22b269accea171692a8 (patch) | |
| tree | 60c640a4b103946d706671ccc2d12fc0d23ed544 /net/unix/af_unix.c | |
| parent | decnet: RCU conversion and get rid of dev_base_lock (diff) | |
| download | kernel-67426b756c4d52c511c4b22b269accea171692a8.tar.gz kernel-67426b756c4d52c511c4b22b269accea171692a8.zip | |
af_unix: use keyed wakeups
Instead of wakeup all sleepers, use wake_up_interruptible_sync_poll() to
wakeup only ones interested into writing the socket.
This patch is a specialization of commit 37e5540b3c9d (epoll keyed
wakeups: make sockets use keyed wakeups).
On a test program provided by Alan Crequy :
Before:
real 0m3.101s
user 0m0.000s
sys 0m6.104s
After:
real 0m0.211s
user 0m0.000s
sys 0m0.208s
Reported-by: Alban Crequy <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Cc: Davide Libenzi <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
| -rw-r--r-- | net/unix/af_unix.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 3c95304a0817..f33c5958dbb2 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -316,7 +316,8 @@ static void unix_write_space(struct sock *sk) if (unix_writable(sk)) { wq = rcu_dereference(sk->sk_wq); if (wq_has_sleeper(wq)) - wake_up_interruptible_sync(&wq->wait); + wake_up_interruptible_sync_poll(&wq->wait, + POLLOUT | POLLWRNORM | POLLWRBAND); sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT); } rcu_read_unlock(); @@ -1710,7 +1711,8 @@ static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock, goto out_unlock; } - wake_up_interruptible_sync(&u->peer_wait); + wake_up_interruptible_sync_poll(&u->peer_wait, + POLLOUT | POLLWRNORM | POLLWRBAND); if (msg->msg_name) unix_copy_addr(msg, skb->sk); |
