From: "Rogozhkin, Dmitry V" <dmitry.v.rogozhkin@intel.com>
To: "peterz@infradead.org" <peterz@infradead.org>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [RFC v2 2/3] drm/i915/pmu: serve global events and support perf stat
Date: Wed, 30 Aug 2017 17:24:30 +0000 [thread overview]
Message-ID: <1504084943.18626.5.camel@intel.com> (raw)
In-Reply-To: <20170829092833.p3vktm2uldwhtyzh@hirez.programming.kicks-ass.net>
On Tue, 2017-08-29 at 11:28 +0200, Peter Zijlstra wrote:
> On Wed, Aug 23, 2017 at 11:38:43PM +0000, Rogozhkin, Dmitry V wrote:
> > On Wed, 2017-08-23 at 08:26 -0700, Dmitry Rogozhkin wrote:
> > > +static cpumask_t i915_pmu_cpumask = CPU_MASK_CPU0;
> >
> > Peter, this hardcoding of cpumask to use CPU0 works, but should I
> > implement something smarter or this will be sufficient? I see that
> > cstate.c you have pointed me to tries to track CPUs going online/offline
> > and migrates PMU context to another CPU if selected one went offline.
> > Should I follow this way?
>
> Yes.. x86 used to not allow hotplug of CPU0, but they 'fixed' that :/
>
> And the perf core needs _a_ valid CPU to run things from, which leaves
> you having to track online/offline things.
>
> Now, I suppose its all fairly similar for a lot of uncore PMUs, so maybe
> you can pull some of this into a library and avoid the endless
> duplication between all (most?) uncore driveres.
>
> > If I should track CPUs going online/offline, then I have questions:
> > 1. How I should register tracking callbacks? I see that cstate.c
> > registers CPUHP_AP_PERF_X86_CSTATE_STARTING and
> > CPUHP_AP_PERF_X86_CSTATE_ONLINE, uncore.c registers
> > CPUHP_AP_PERF_X86_UNCORE_ONLINE. What I should use? I incline to UNCORE.
>
> Egads, what a mess :/ Clearly I didn't pay too much attention there.
>
> So ideally we'd not hate a state per PMU, and
> __cpuhp_setup_state_cpuslocked() has a .multi_instance argument that
> allows reuse of a state.
>
> So yes, please use the PERF_X86_UNCORE ones if possible.
>
> > 2. If I will register for, say UNCORE, then how double registrations
> > will be handled if both uncore.c and i915.c will register callbacks? Any
> > conflict here?
>
> Should work with .multi_instance I _think_, I've not had the pleasure of
> using the new and improved CPU hotplug infrastructure much.
>
> > 3. What I should pass as 2nd argument? Will "perf/x86/intel/i915:online"
> > be ok?
>
> Yeah, whatever I think.. something unique. Someone or something will
> eventually yell if its no good I suppose ;-)
I figured out how to track cpus online/offline status in PMU. Here is a
question however. What is the reason for uncore PMUs (cstate.c for
example) to register for cpus other than cpu0? I see it registers for
first thread of each cpu, on my 8 logical-core systems it registers for
cpu0-3 it seems. If they register for few cpus then perf-stat will
aggregate counters which can be disabled with '-A, --no-aggr' option.
Ok... but they could register for just cpu0. Besides, it looks like on
Linux cpu0 can't go offline at all at least of x86 architecture. Peter,
could you, please, clarify the reasoning to register designated readers
of uncore PMU for few CPUs?
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-08-30 17:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-23 15:26 [RFC v2 0/3] Support perf stat with i915 PMU Dmitry Rogozhkin
2017-08-23 15:26 ` [RFC v2 1/3] drm/i915/pmu: reorder function to suite next patch Dmitry Rogozhkin
2017-08-23 15:26 ` [RFC v2 2/3] drm/i915/pmu: serve global events and support perf stat Dmitry Rogozhkin
2017-08-23 23:38 ` Rogozhkin, Dmitry V
2017-08-28 22:45 ` Rogozhkin, Dmitry V
2017-08-29 9:28 ` Peter Zijlstra
2017-08-30 17:24 ` Rogozhkin, Dmitry V [this message]
2017-08-30 20:03 ` Peter Zijlstra
2017-08-30 20:05 ` Peter Zijlstra
2017-08-23 15:26 ` [RFC v2 3/3] drm/i915/pmu: deny perf driver level sampling of i915 PMU Dmitry Rogozhkin
2017-08-23 23:43 ` Rogozhkin, Dmitry V
[not found] ` <3EDB40B547243546A1017B798F8C1AA8847FC002@ORSMSX114.amr.corp.intel.com>
[not found] ` <150368515309.27971.17522435118048475155@mail.alporthouse.com>
2017-08-25 19:01 ` Rogozhkin, Dmitry V
2017-08-31 7:41 ` 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=1504084943.18626.5.camel@intel.com \
--to=dmitry.v.rogozhkin@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=peterz@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.