Re: [PATCH net] rds: Make sure updates to cp_send_gen can be observed

2017-07-20 Thread David Miller
From: Håkon Bugge Date: Thu, 20 Jul 2017 12:28:55 +0200 > cp->cp_send_gen is treated as a normal variable, although it may be > used by different threads. > > This is fixed by using {READ,WRITE}_ONCE when it is incremented and > READ_ONCE when it is read outside the {acquire,release}_in_xmit > p

Re: [PATCH net] rds: Make sure updates to cp_send_gen can be observed

2017-07-20 Thread Santosh Shilimkar
On 7/20/2017 3:28 AM, Håkon Bugge wrote: cp->cp_send_gen is treated as a normal variable, although it may be used by different threads. This is fixed by using {READ,WRITE}_ONCE when it is incremented and READ_ONCE when it is read outside the {acquire,release}_in_xmit protection. There is expli

Re: [PATCH net] rds: Make sure updates to cp_send_gen can be observed

2017-07-20 Thread Håkon Bugge
> On 20 Jul 2017, at 13:02, Sowmini Varadhan > wrote: > > On (07/20/17 12:28), H??kon Bugge wrote: >> cp->cp_send_gen is treated as a normal variable, although it may be >> used by different threads. > > I'm confused by that assertion. If you look at the comments right > above the change in yo

Re: [PATCH net] rds: Make sure updates to cp_send_gen can be observed

2017-07-20 Thread Sowmini Varadhan
On (07/20/17 12:28), H??kon Bugge wrote: > cp->cp_send_gen is treated as a normal variable, although it may be > used by different threads. I'm confused by that assertion. If you look at the comments right above the change in your patch, there is a note that acquire_in_xmit/release_in_xmit are th

[PATCH net] rds: Make sure updates to cp_send_gen can be observed

2017-07-20 Thread Håkon Bugge
cp->cp_send_gen is treated as a normal variable, although it may be used by different threads. This is fixed by using {READ,WRITE}_ONCE when it is incremented and READ_ONCE when it is read outside the {acquire,release}_in_xmit protection. Normative reference from the Linux-Kernel Memory Model: