public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH] perf mmap: Convert ACCESS_ONCE() to READ_ONCE()
Date: Tue, 14 Nov 2017 14:08:55 -0800	[thread overview]
Message-ID: <20171114220855.GE3624@linux.vnet.ibm.com> (raw)
In-Reply-To: <20171114103138.9931-1-mark.rutland@arm.com>

On Tue, Nov 14, 2017 at 10:31:38AM +0000, Mark Rutland wrote:
> Recently there was a treewide conversion of ACCESS_ONCE() to
> {READ,WRITE}_ONCE(), but a new use was introduced concurrently by
> commit:
> 
>   1695849735752d2a ("perf mmap: Move perf_mmap and methods to separate mmap.[ch] files")
> 
> Let's convert this over to READ_ONCE() so that we can remove the
> ACCESS_ONCE() definitions in subsequent patches.
> 
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Cc: Peter Zijlstra <peterz@infradead.org>

Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

Woo-hoo!  Good to see that your Coccinelle script has already done
its magic!  ;-)

							Thanx, Paul

> ---
>  tools/perf/util/mmap.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Hi,
> 
> Would it be possible for this to be taken as a fixup in an upcoming rc? That
> way we should be able to remove the ACCESS_ONCE() definitions prior to v4.15.
> 
> Thanks,
> Mark.
> 
> diff --git a/tools/perf/util/mmap.h b/tools/perf/util/mmap.h
> index efd78b827b05..3a5cb5a6e94a 100644
> --- a/tools/perf/util/mmap.h
> +++ b/tools/perf/util/mmap.h
> @@ -70,7 +70,7 @@ void perf_mmap__read_catchup(struct perf_mmap *md);
>  static inline u64 perf_mmap__read_head(struct perf_mmap *mm)
>  {
>  	struct perf_event_mmap_page *pc = mm->base;
> -	u64 head = ACCESS_ONCE(pc->data_head);
> +	u64 head = READ_ONCE(pc->data_head);
>  	rmb();
>  	return head;
>  }
> -- 
> 2.11.0
> 

  reply	other threads:[~2017-11-14 22:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-14 10:31 [PATCH] perf mmap: Convert ACCESS_ONCE() to READ_ONCE() Mark Rutland
2017-11-14 22:08 ` Paul E. McKenney [this message]
2017-11-14 22:21   ` Joe Perches
2017-11-14 22:56     ` Paul E. McKenney

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=20171114220855.GE3624@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=acme@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /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