tcp: add memory barriers to write space paths
Ensure that we either see that the buffer has write space in tcp_poll() or that we perform a wakeup from the input side. Did not run into any actual problem here, but thought that we should make things explicit. Signed-off-by: Jason Baron <jbaron@akamai.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
71cd26e76a
commit
3c7151275c
@@ -520,8 +520,10 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
|
||||
|
||||
/* Race breaker. If space is freed after
|
||||
* wspace test but before the flags are set,
|
||||
* IO signal will be lost.
|
||||
* IO signal will be lost. Memory barrier
|
||||
* pairs with the input side.
|
||||
*/
|
||||
smp_mb__after_atomic();
|
||||
if (sk_stream_is_writeable(sk))
|
||||
mask |= POLLOUT | POLLWRNORM;
|
||||
}
|
||||
|
Reference in New Issue
Block a user