[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20170720.153319.615690739132189305.davem@davemloft.net>
Date: Thu, 20 Jul 2017 15:33:19 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: Haakon.Bugge@...cle.com
Cc: santosh.shilimkar@...cle.com, netdev@...r.kernel.org,
linux-rdma@...r.kernel.org, rds-devel@....oracle.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] rds: Make sure updates to cp_send_gen can be
observed
From: Håkon Bugge <Haakon.Bugge@...cle.com>
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
> protection.
>
> Normative reference from the Linux-Kernel Memory Model:
>
> Loads from and stores to shared (but non-atomic) variables should
> be protected with the READ_ONCE(), WRITE_ONCE(), and
> ACCESS_ONCE().
>
> Clause 5.1.2.4/25 in the C standard is also relevant.
>
> Signed-off-by: Håkon Bugge <haakon.bugge@...cle.com>
> Reviewed-by: Knut Omang <knut.omang@...cle.com>
Applied, thanks.
Powered by blists - more mailing lists