Hello, smp_mb__after_atomic() looks wrong and misleading, sock_reset_flag() does the non-atomic __clear_bit() and thus it can not guarantee test_bit(SOCK_NOSPACE) (non-atomic too) won't be reordered.
It was added by 3c7151275c0c9a "tcp: add memory barriers to write space paths" and the patch looks correct in that we need the barriers in tcp_check_space() and tcp_poll() in theory, so it seems tcp_check_space() needs smp_mb() ? Oleg.