mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 08:44:21 +08:00
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>
This commit is contained in:
parent
9317bb6982
commit
4be735225f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user