public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
* perf_mmap__write_tail() and control dependencies
@ 2015-07-24 15:29 Paul E. McKenney
  2015-07-24 15:33 ` Peter Zijlstra
  0 siblings, 1 reply; 5+ messages in thread
From: Paul E. McKenney @ 2015-07-24 15:29 UTC (permalink / raw)
  To: peterz; +Cc: will.deacon, linux-kernel, linux-arch, paulus, rostedt

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-24 15:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-24 15:29 perf_mmap__write_tail() and control dependencies Paul E. McKenney
2015-07-24 15:33 ` Peter Zijlstra
2015-07-24 15:35   ` Peter Zijlstra
2015-07-24 15:36   ` Will Deacon
2015-07-24 15:49     ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox