diff options
author | Eric Dumazet <edumazet@google.com> | 2016-04-25 19:39:34 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-28 05:08:40 +0200 |
commit | 4be735225f7cd040ca81c18740e7b672021bafeb (patch) | |
tree | 36276766d7de862ca9ade5b3d32303439c1d18ad /include/net/sock.h | |
parent | net: SOCKWQ_ASYNC_NOSPACE optimizations (diff) | |
download | linux-4be735225f7cd040ca81c18740e7b672021bafeb.tar.xz linux-4be735225f7cd040ca81c18740e7b672021bafeb.zip |
net: SOCKWQ_ASYNC_WAITDATA optimizations
SOCKWQ_ASYNC_WAITDATA is set/cleared in sk_wait_data()
and equivalent functions, so that sock_wake_async() can send
a SIGIO only when necessary.
Since these atomic operations are really not needed unless
socket expressed interest in FASYNC, we can omit them in most
cases.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 0f48aad9f8e8..3df778ccaa82 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -1940,7 +1940,8 @@ static inline unsigned long sock_wspace(struct sock *sk) */ static inline void sk_set_bit(int nr, struct sock *sk) { - if (nr == SOCKWQ_ASYNC_NOSPACE && !sock_flag(sk, SOCK_FASYNC)) + if ((nr == SOCKWQ_ASYNC_NOSPACE || nr == SOCKWQ_ASYNC_WAITDATA) && + !sock_flag(sk, SOCK_FASYNC)) return; set_bit(nr, &sk->sk_wq_raw->flags); @@ -1948,7 +1949,8 @@ static inline void sk_set_bit(int nr, struct sock *sk) static inline void sk_clear_bit(int nr, struct sock *sk) { - if (nr == SOCKWQ_ASYNC_NOSPACE && !sock_flag(sk, SOCK_FASYNC)) + if ((nr == SOCKWQ_ASYNC_NOSPACE || nr == SOCKWQ_ASYNC_WAITDATA) && + !sock_flag(sk, SOCK_FASYNC)) return; clear_bit(nr, &sk->sk_wq_raw->flags); |