summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-04-27 23:08:41 -0400
committerDavid S. Miller <davem@davemloft.net>2016-04-27 23:08:41 -0400
commit8be2748a40cb84c2ac5085e7e6bccb5a5fcc6235 (patch)
tree36276766d7de862ca9ade5b3d32303439c1d18ad /include
parent210732d16d20f0c18fc5e5dcdf726c8b02b81957 (diff)
parent4be735225f7cd040ca81c18740e7b672021bafeb (diff)
downloadlinux-8be2748a40cb84c2ac5085e7e6bccb5a5fcc6235.tar.bz2
Merge branch 'socket-space-optimizations'
Eric Dumazet says: ==================== net: avoid some atomic ops when FASYNC is not used We can avoid some atomic operations on sockets not using FASYNC ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/sock.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index d63b8494124e..3df778ccaa82 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1940,11 +1940,19 @@ 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 || nr == SOCKWQ_ASYNC_WAITDATA) &&
+ !sock_flag(sk, SOCK_FASYNC))
+ return;
+
set_bit(nr, &sk->sk_wq_raw->flags);
}
static inline void sk_clear_bit(int nr, struct sock *sk)
{
+ if ((nr == SOCKWQ_ASYNC_NOSPACE || nr == SOCKWQ_ASYNC_WAITDATA) &&
+ !sock_flag(sk, SOCK_FASYNC))
+ return;
+
clear_bit(nr, &sk->sk_wq_raw->flags);
}