Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: Haakon.Bugge@oracle.com
Cc: santosh.shilimkar@oracle.com, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] rds: Make sure updates to cp_send_gen can be observed
Date: Thu, 20 Jul 2017 15:33:19 -0700 (PDT)	[thread overview]
Message-ID: <20170720.153319.615690739132189305.davem@davemloft.net> (raw)
In-Reply-To: <20170720102855.21961-1-Haakon.Bugge@oracle.com>

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.

      parent reply	other threads:[~2017-07-20 22:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-20 10:28 [PATCH net] rds: Make sure updates to cp_send_gen can be observed Håkon Bugge
2017-07-20 11:02 ` Sowmini Varadhan
2017-07-20 11:24   ` Håkon Bugge
2017-07-20 16:50 ` Santosh Shilimkar
2017-07-20 22:33 ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170720.153319.615690739132189305.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=Haakon.Bugge@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rds-devel@oss.oracle.com \
    --cc=santosh.shilimkar@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox