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

Commit 8be2748a authored by David S. Miller's avatar David S. Miller
Browse files

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 210732d1 4be73522
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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);
}