archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/1] Add tracepoints around mmap_lock acquisition
@ 2020-10-20 18:47 Axel Rasmussen
  2020-10-20 18:47 ` [PATCH v4 1/1] mmap_lock: add tracepoints around lock acquisition Axel Rasmussen
  0 siblings, 1 reply; 6+ messages in thread
From: Axel Rasmussen @ 2020-10-20 18:47 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar, Andrew Morton, Michel Lespinasse,
	Vlastimil Babka, Daniel Jordan, Jann Horn, Chinwen Chang,
	Davidlohr Bueso, David Rientjes
  Cc: Yafang Shao, linux-kernel, linux-mm, Axel Rasmussen

This patchset adds tracepoints around mmap_lock acquisition. This is useful so
we can measure the latency of lock acquisition, in order to detect contention.

This version is based upon linux-next (since it depends on some recently-merged
patches [1] [2]).

Changes since v3:

- Switched EXPORT_SYMBOL to EXPORT_TRACEPOINT_SYMBOL, removed comment.

- Removed redundant trace_..._enabled() check.

- Defined the three TRACE_EVENTs separately, instead of sharing an event class.
  The tradeoff is 524 more bytes in .text, but the start_locking and released
  events no longer have a vestigial "success" field, so they're simpler +

Changes since v2:

- Refactored tracing helper functions so the helpers are simper, but the locking
  functinos are slightly more verbose. Overall, this decreased the delta to
  mmap_lock.h slightly.

- Fixed a typo in a comment. :)

Changes since v1:

- Functions renamed to reserve the "trace_" prefix for actual tracepoints.

- We no longer measure the duration directly. Instead, users are expected to
  construct a synthetic event which computes the interval between "start
  locking" and "acquire returned".

- The new helper for checking if tracepoints are enabled in a header is used to
  avoid un-inlining any of the lock wrappers. This yields ~zero overhead if the
  tracepoints aren't enabled, and therefore obviates the need for a Kconfig for
  this change.


Axel Rasmussen (1):
  mmap_lock: add tracepoints around lock acquisition

 include/linux/mmap_lock.h        | 93 ++++++++++++++++++++++++++++--
 include/trace/events/mmap_lock.h | 98 ++++++++++++++++++++++++++++++++
 mm/Makefile                      |  2 +-
 mm/mmap_lock.c                   | 80 ++++++++++++++++++++++++++
 4 files changed, 267 insertions(+), 6 deletions(-)
 create mode 100644 include/trace/events/mmap_lock.h
 create mode 100644 mm/mmap_lock.c


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

end of thread, other threads:[~2020-10-26 14:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20 18:47 [PATCH v4 0/1] Add tracepoints around mmap_lock acquisition Axel Rasmussen
2020-10-20 18:47 ` [PATCH v4 1/1] mmap_lock: add tracepoints around lock acquisition Axel Rasmussen
2020-10-23 13:59   ` Vlastimil Babka
2020-10-23 17:38     ` Axel Rasmussen
2020-10-23 17:56       ` Vlastimil Babka
2020-10-26 14:54         ` Steven Rostedt

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).