From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: peterz@infradead.org
Cc: will.deacon@arm.com, linux-kernel@vger.kernel.org,
linux-arch@vger.kernel.org, paulus@samba.org,
rostedt@goodmis.org
Subject: perf_mmap__write_tail() and control dependencies
Date: Fri, 24 Jul 2015 08:29:05 -0700 [thread overview]
Message-ID: <20150724152905.GA4766@linux.vnet.ibm.com> (raw)
Hello, Peter,
The ring-buffer code uses control dependencies, and the shiny new
READ_ONCE_CTRL() is now in mainline. I was idly curious about whether
the write side could use smp_store_release(), and I found this:
static inline void perf_mmap__write_tail(struct perf_mmap *md, u64 tail)
{
struct perf_event_mmap_page *pc = md->base;
/*
* ensure all reads are done before we write the tail out.
*/
mb();
pc->data_tail = tail;
}
I see mb() rather than smp_mb(). Did I find the correct code for the
write side? If so, why mb() rather than smp_mb()? To serialize against
MMIO interactions with hardware counters or some such?
Thanx, Paul
next reply other threads:[~2015-07-24 15:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-24 15:29 Paul E. McKenney [this message]
2015-07-24 15:33 ` perf_mmap__write_tail() and control dependencies Peter Zijlstra
2015-07-24 15:35 ` Peter Zijlstra
2015-07-24 15:36 ` Will Deacon
2015-07-24 15:49 ` 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=20150724152905.GA4766@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=will.deacon@arm.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