Re: [PATCH net] tcp: correct memory barrier usage in tcp_check_space()

2017-02-04 Thread Herbert Xu
On Sat, Feb 04, 2017 at 07:19:37AM -0800, Eric Dumazet wrote: > > > The comment says that it's pairing with an mb in tcp_poll, but > > tcp_poll doesn't touch QUEUE_SHRUNK at all. So what exactly is > > this barrier for? > > Do not focus on QUEUE_SHRUNK flag, which is locally used by this thread >

Re: [PATCH net] tcp: correct memory barrier usage in tcp_check_space()

2017-02-04 Thread Eric Dumazet
On Sat, 2017-02-04 at 17:59 +0800, Herbert Xu wrote: > Jason Baron wrote: > > From: Jason Baron > > > > sock_reset_flag() maps to __clear_bit() not the atomic version clear_bit(). > > Thus, we need smp_mb(), smp_mb__after_atomic() is not sufficient. > > > > Fixes: 3c7151275c0c ("tcp: add memory

Re: [PATCH net] tcp: correct memory barrier usage in tcp_check_space()

2017-02-04 Thread Herbert Xu
Jason Baron wrote: > From: Jason Baron > > sock_reset_flag() maps to __clear_bit() not the atomic version clear_bit(). > Thus, we need smp_mb(), smp_mb__after_atomic() is not sufficient. > > Fixes: 3c7151275c0c ("tcp: add memory barriers to write space paths") > Cc: Eric Dumazet > Cc: Oleg Nes

Re: [PATCH net] tcp: correct memory barrier usage in tcp_check_space()

2017-01-25 Thread David Miller
From: Eric Dumazet Date: Tue, 24 Jan 2017 20:53:37 -0800 > On Tue, 2017-01-24 at 21:49 -0500, Jason Baron wrote: >> From: Jason Baron >> >> sock_reset_flag() maps to __clear_bit() not the atomic version clear_bit(). >> Thus, we need smp_mb(), smp_mb__after_atomic() is not sufficient. >> >> Fix

Re: [PATCH net] tcp: correct memory barrier usage in tcp_check_space()

2017-01-24 Thread Eric Dumazet
On Tue, 2017-01-24 at 21:49 -0500, Jason Baron wrote: > From: Jason Baron > > sock_reset_flag() maps to __clear_bit() not the atomic version clear_bit(). > Thus, we need smp_mb(), smp_mb__after_atomic() is not sufficient. > > Fixes: 3c7151275c0c ("tcp: add memory barriers to write space paths")

[PATCH net] tcp: correct memory barrier usage in tcp_check_space()

2017-01-24 Thread Jason Baron
From: Jason Baron sock_reset_flag() maps to __clear_bit() not the atomic version clear_bit(). Thus, we need smp_mb(), smp_mb__after_atomic() is not sufficient. Fixes: 3c7151275c0c ("tcp: add memory barriers to write space paths") Cc: Eric Dumazet Cc: Oleg Nesterov Signed-off-by: Jason Baron -