• Eric Dumazet's avatar
    tcp: remove poll() flakes when receiving RST · 3d476263
    Eric Dumazet authored
    When a RST packet is processed, we send two wakeup events to interested
    polling users.
    
    First one by a sk->sk_error_report(sk) from tcp_reset(),
    followed by a sk->sk_state_change(sk) from tcp_done().
    
    Depending on machine load and luck, poll() can either return POLLERR,
    or POLLIN|POLLOUT|POLLERR|POLLHUP (this happens on 99 % of the cases)
    
    This is probably fine, but we can avoid the confusion by reordering
    things so that we have more TCP fields updated before the first wakeup.
    
    This might even allow us to remove some barriers we added in the past.
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    3d476263
tcp_input.c 183 KB