mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Song Liu <songliubraving@fb.com>
To: <linux-kernel@vger.kernel.org>
Cc: Song Liu <songliubraving@fb.com>, <kernel-team@fb.com>,
	<tj@kernel.org>, <peterz@infradead.org>, <jolsa@kernel.org>
Subject: [RFC 0/2] perf: Sharing PMU counters across compatible events
Date: Fri, 4 May 2018 16:11:00 -0700	[thread overview]
Message-ID: <20180504231102.2850679-1-songliubraving@fb.com> (raw)

This is to follow up earlier discussion on sharing hardware PMU counters
across compatible events: https://marc.info/?t=151213803600016

A lot of this set is based on Tejun's work. I also got a lot of ideas and
insights from Jiri's version.

The major effort in this version is to make perf event scheduling faster.
Specifically, all the operations on the critical paths have O(1) execution
time. Commit message of RFC 2/2 has more information about the data
structure we used for these operations.

RFC 1/2 is a prepare patch. It may become unnecessary if we introduce
virtual master later on.

RFC 2/2 has majority of the new data structure, and operations.

I have test this version on vm with tracepoint events. I also briefly
tested it on real hardware, where it shows sharing of perf events and
doesn't break too badly.

Please share your comments and suggestions. Is this on the right direction
of PMU counter sharing?

Thanks in advance.
Song

Song Liu (2):
  perf: add move_dup() for PMU sharing.
  perf: Sharing PMU counters across compatible events

 arch/x86/events/core.c          |   8 ++
 include/linux/perf_event.h      |  57 +++++++++
 include/linux/trace_events.h    |   3 +
 kernel/events/core.c            | 255 +++++++++++++++++++++++++++++++++++++---
 kernel/trace/trace_event_perf.c |  11 ++
 5 files changed, 316 insertions(+), 18 deletions(-)

--
2.9.5

             reply	other threads:[~2018-05-04 23:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-04 23:11 Song Liu [this message]
2018-05-04 23:11 ` [RFC 1/2] perf: add move_dup() for PMU sharing Song Liu
2018-05-04 23:11 ` [RFC 2/2] perf: Sharing PMU counters across compatible events Song Liu
2018-05-28 11:15   ` Peter Zijlstra
2018-05-28 18:24     ` Song Liu
2018-05-28 11:24   ` Peter Zijlstra
2018-05-28 18:19     ` Song Liu
2018-05-28 11:26   ` Peter Zijlstra
2018-05-28 11:33   ` Peter Zijlstra

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=20180504231102.2850679-1-songliubraving@fb.com \
    --to=songliubraving@fb.com \
    --cc=jolsa@kernel.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tj@kernel.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

all inboxes | Powered by JetHome®