To: Mark Rutland <firstname.lastname@example.org>
Cc: Peter Zijlstra <email@example.com>,
Ingo Molnar <firstname.lastname@example.org>,
Arnaldo Carvalho de Melo <email@example.com>,
Alexander Shishkin <firstname.lastname@example.org>,
Jiri Olsa <email@example.com>, Namhyung Kim <firstname.lastname@example.org>,
Subject: Re: [PATCH v1 2/2] perf/core: Add support for PMUs that can be read from any CPU
Date: Mon, 26 Feb 2018 18:11:45 -0800 [thread overview]
Message-ID: <email@example.com> (raw)
On 2018-02-25 06:38, Mark Rutland wrote:
> On Fri, Feb 23, 2018 at 04:19:38PM -0800, Saravana Kannan wrote:
>> Some PMUs events can be read from any CPU. So allow the PMU to mark
>> events as such. For these events, we don't need to reject reads or
>> make smp calls to the event's CPU and cause unnecessary wake ups.
>> Good examples of such events would be events from caches shared across
>> all CPUs.
> I think that if we need to generalize PERF_EV_CAP_READ_ACTIVE_PKG, it
> would be
> better to give events a pointer to a cpumask. That could then cover all
> quite trivially:
> static int __perf_event_read_cpu(struct perf_event *event, int
> int local_cpu = smp_processor_id();
> if (event->read_mask &&
> cpumask_test_cpu(local_cpu, event->read_mask))
> event_cpu = local_cpu;
> return event_cpu;
This is a good improvement on my attempt. If I send a patch for this, is
that something you'd be willing to incorporate into your patch set and
make sure the DSU pmu driver handles it correctly?
> ... in the PERF_EV_CAP_READ_ACTIVE_PKG case, we can use the exiting(?)
> masks, and more generally we can re-use the PMU's affinit mask if it
> has one.
> That said, I see that many pmu::read() implementations have
> side-effects on
> hwc->prev_count, and event->count, so I worry that this won't be sfe in
> (e.g. if we race with the IRQ handler on another CPU).
Yeah, this doesn't have to be mandatory. It can be an optional mask the
PMU can set up during perf event init.
Is this something that's acceptable to you?
next prev parent reply other threads:[~2018-02-27 2:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-24 0:19 [PATCH v1 1/2] perf/core: Add API to look up PMU type by name Saravana Kannan
2018-02-24 0:19 ` [PATCH v1 2/2] perf/core: Add support for PMUs that can be read from any CPU Saravana Kannan
2018-02-24 0:56 ` Saravana Kannan
2018-02-24 8:41 ` Peter Zijlstra
2018-02-27 1:53 ` skannan
2018-02-27 11:52 ` Mark Rutland
2018-03-03 15:41 ` Peter Zijlstra
2018-03-07 16:39 ` Jeremy Linton
2018-02-25 14:38 ` Mark Rutland
2018-02-27 2:11 ` skannan [this message]
2018-02-27 11:43 ` Mark Rutland
2018-02-27 23:15 ` skannan
2018-02-24 8:08 ` [PATCH v1 1/2] perf/core: Add API to look up PMU type by name Peter Zijlstra
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:
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* 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;
as well as URLs for NNTP newsgroup(s).