Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1693267
| From | David Miller <davem@davemloft.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH net] rds: Make sure updates to cp_send_gen can be observed |
| Date | 2017-07-21 00:40 +0200 |
| Message-ID | <u5sgW-4Zm-19@gated-at.bofh.it> (permalink) |
| References | <u5gSv-5Zw-55@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Håkon Bugge <Haakon.Bugge@oracle.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@oracle.com>
> Reviewed-by: Knut Omang <knut.omang@oracle.com>
Applied, thanks.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH net] rds: Make sure updates to cp_send_gen can be observed Håkon Bugge <Haakon.Bugge@oracle.com> - 2017-07-20 12:30 +0200
Re: [PATCH net] rds: Make sure updates to cp_send_gen can be observed Sowmini Varadhan <sowmini.varadhan@oracle.com> - 2017-07-20 13:10 +0200
Re: [PATCH net] rds: Make sure updates to cp_send_gen can be observed Håkon Bugge <haakon.bugge@oracle.com> - 2017-07-20 13:30 +0200
Re: [PATCH net] rds: Make sure updates to cp_send_gen can be observed Santosh Shilimkar <santosh.shilimkar@oracle.com> - 2017-07-20 18:50 +0200
Re: [PATCH net] rds: Make sure updates to cp_send_gen can be observed David Miller <davem@davemloft.net> - 2017-07-21 00:40 +0200
csiph-web