linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/9] perf: Refine barriers for AUX ring buffer
@ 2021-08-09 11:13 Leo Yan
  2021-08-09 11:13 ` [PATCH v5 1/9] perf/ring_buffer: Add comment for barriers on " Leo Yan
                   ` (8 more replies)
  0 siblings, 9 replies; 24+ messages in thread
From: Leo Yan @ 2021-08-09 11:13 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Peter Zijlstra, Adrian Hunter,
	Ingo Molnar, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, Thomas Gleixner, Borislav Petkov, H. Peter Anvin,
	Mathieu Poirier, Suzuki K Poulose, Mike Leach, Michael Petlan,
	Frank Ch. Eigler, Song Liu, x86, Daniel Díaz,
	Andrii Nakryiko, Alexei Starovoitov, Sedat Dilek, Andi Kleen,
	linux-perf-users, linux-kernel, coresight
  Cc: Leo Yan

This patch series is to refine the memory barriers for AUX ring buffer.

Patches 01 ~ 04 to address the barriers usage in the kernel.  The first
patch is to make clear comment for how to use the barriers between the
data store and aux_head store, this asks the driver to make sure the
data is visible.  Patches 02 ~ 04 is to refine the drivers for barriers
after the data store.

Patch 05 is to use WRITE_ONCE() for updating aux_tail.

Patches 06 ~ 09 is to drop the legacy __sync functions, and polish for
duplicate code and cleanup the build and feature test after
SYNC_COMPARE_AND_SWAP is not used.

For easier review and more clear patch organization, comparing against
to the previous patch series, the patches for support compat mode for
AUX trace have been left out and will be sent out as a separate patch
set.

This patch set have been tested on Arm64 Juno platform.

Changes from v4:
- Refined comment for CoreSight ETR/ETF drivers (Suzuki/Peter);
- Changed to use compiler barrier for BTS (mentioned by Peter, but have
  not received response from Intel developer);
- Refined the coding style for patch 07 (Adrian).

Changes from v3:
- Removed the inapprocate paragraph in the commit log for patch "perf
  auxtrace: Drop legacy __sync functions" (Adrian);
- Added new patch to remove feature-sync-compare-and-swap test (Adrian);
- Th patch for "perf auxtrace: Use WRITE_ONCE() for updating aux_tail",
  is a standlone and simple change, so moved it ahead in the patch set
  for better ordering;
- Minor improvement for commit logs in the last two patches.

Changes from v2:
- Removed auxtrace_mmap__read_snapshot_head(), which has the duplicated
  code with auxtrace_mmap__read_head();
- Cleanuped the build for HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT (Adrian);
- Added global variable "kernel_is_64_bit" (Adrian);
- Added compat variants compat_auxtrace_mmap__{read_head|write_tail}
  (Adrian).


Leo Yan (9):
  perf/ring_buffer: Add comment for barriers on AUX ring buffer
  coresight: tmc-etr: Add barrier after updating AUX ring buffer
  coresight: tmc-etf: Add comment for store ordering
  perf/x86: Add compiler barrier after updating BTS
  perf auxtrace: Use WRITE_ONCE() for updating aux_tail
  perf auxtrace: Drop legacy __sync functions
  perf auxtrace: Remove auxtrace_mmap__read_snapshot_head()
  perf: Cleanup for HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT
  tools: Remove feature-sync-compare-and-swap feature detection

 arch/x86/events/intel/bts.c                   |  6 ++++
 .../hwtracing/coresight/coresight-tmc-etf.c   |  5 +++
 .../hwtracing/coresight/coresight-tmc-etr.c   |  8 +++++
 kernel/events/ring_buffer.c                   |  9 ++++++
 tools/build/Makefile.feature                  |  1 -
 tools/build/feature/Makefile                  |  4 ---
 tools/build/feature/test-all.c                |  4 ---
 .../feature/test-sync-compare-and-swap.c      | 15 ---------
 tools/perf/Makefile.config                    |  4 ---
 tools/perf/util/auxtrace.c                    | 18 +++--------
 tools/perf/util/auxtrace.h                    | 31 +------------------
 11 files changed, 34 insertions(+), 71 deletions(-)
 delete mode 100644 tools/build/feature/test-sync-compare-and-swap.c

-- 
2.25.1


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

end of thread, other threads:[~2021-09-17 15:10 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-09 11:13 [PATCH v5 0/9] perf: Refine barriers for AUX ring buffer Leo Yan
2021-08-09 11:13 ` [PATCH v5 1/9] perf/ring_buffer: Add comment for barriers on " Leo Yan
2021-08-29 10:51   ` Leo Yan
2021-08-09 11:14 ` [PATCH v5 2/9] coresight: tmc-etr: Add barrier after updating " Leo Yan
2021-08-29 10:55   ` Leo Yan
2021-09-14  9:08     ` Suzuki K Poulose
2021-08-09 11:14 ` [PATCH v5 3/9] coresight: tmc-etf: Add comment for store ordering Leo Yan
2021-09-14  8:24   ` Suzuki K Poulose
2021-08-09 11:14 ` [PATCH v5 4/9] perf/x86: Add compiler barrier after updating BTS Leo Yan
2021-08-29 10:56   ` Leo Yan
2021-09-14  9:51     ` Peter Zijlstra
2021-09-14 10:05       ` Leo Yan
2021-09-14 11:47         ` Peter Zijlstra
2021-09-17 15:10   ` [tip: perf/core] " tip-bot2 for Leo Yan
2021-08-09 11:14 ` [PATCH v5 5/9] perf auxtrace: Use WRITE_ONCE() for updating aux_tail Leo Yan
2021-08-09 19:59   ` Arnaldo Carvalho de Melo
2021-08-09 11:14 ` [PATCH v5 6/9] perf auxtrace: Drop legacy __sync functions Leo Yan
2021-08-09 20:00   ` Arnaldo Carvalho de Melo
2021-08-09 11:14 ` [PATCH v5 7/9] perf auxtrace: Remove auxtrace_mmap__read_snapshot_head() Leo Yan
2021-08-09 20:01   ` Arnaldo Carvalho de Melo
2021-08-09 11:14 ` [PATCH v5 8/9] perf: Cleanup for HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT Leo Yan
2021-08-09 20:02   ` Arnaldo Carvalho de Melo
2021-08-09 11:14 ` [PATCH v5 9/9] tools: Remove feature-sync-compare-and-swap feature detection Leo Yan
2021-08-09 20:02   ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).