From: Mark Rutland <mark.rutland@arm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Will Deacon <Will.Deacon@arm.com>,
Dave P Martin <Dave.Martin@arm.com>,
Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH 7/7] perf: kill perf_event_context::pmu
Date: Thu, 27 Feb 2014 12:30:35 +0000 [thread overview]
Message-ID: <20140227123035.GA8647@e106331-lin.cambridge.arm.com> (raw)
In-Reply-To: <20140227115143.GC9987@twins.programming.kicks-ass.net>
On Thu, Feb 27, 2014 at 11:51:43AM +0000, Peter Zijlstra wrote:
> On Thu, Feb 27, 2014 at 11:48:05AM +0000, Mark Rutland wrote:
> > On Tue, Feb 25, 2014 at 11:31:00AM +0000, Peter Zijlstra wrote:
> > > On Tue, Feb 11, 2014 at 05:56:51PM +0000, Mark Rutland wrote:
> > > > Another option would be to have a context per-pmu. Each context's pmu
> > > > pointer would be valid, and (other than the case of software events) it
> > > > doesn't make sense to place events from disparate PMUs into the same
> > > > group anyway. Then you don't need a fixed sized pmu list in the context
> > > > or some arcane list structs.
> > >
> > > No it does make sense; for example on hardware that doesn't have a PMI
> > > you can create a software event + hardware event group and have the
> > > software interrupt read the hardware counter and still get 'some'
> > > sampling.
> >
> > Sure, I called out software events as an exception above.
>
> Oh sorry missed that.
>
> > Does it ever make sense to group two hardware events for disparate
> > hardware PMUs?
>
> No, and I think we disallow that. We only explicitly allow software
> events/groups to move to !software context.
As you say, other than the sw leader, hw follower case we currently
check that event->ctx is equivalent. This works for homogeneous PMUs, as
we only ever have one PMU in any task's
perf_event_ctxp[perf_hw_context].
In the heterogeneous PMU case multiple CPU PMUs can share the
perf_hw_context in a task, so the check for context equivalence is not
sufficient.
I can hide the check in the architecture backend, or we could try to
make the core code be more picky with something like the below.
---->8----
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 56003c6..a4b6f80 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7135,6 +7135,8 @@ SYSCALL_DEFINE5(perf_event_open,
if (group_leader->ctx->type != ctx->type)
goto err_context;
} else {
+ if (group_leader->pmu != pmu)
+ goto err_context;
if (group_leader->ctx != ctx)
goto err_context;
}
---->8----
Cheers,
Mark.
next prev parent reply other threads:[~2014-02-27 12:31 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-10 17:44 [PATCH 0/7] Perf core cleanups for shared perf_event_contexts Mark Rutland
2014-02-10 17:44 ` [PATCH 1/7] perf: fix prototype of find_pmu_context Mark Rutland
2014-02-27 13:33 ` [tip:perf/core] perf: Fix prototype of find_pmu_context() tip-bot for Mark Rutland
2014-02-10 17:44 ` [PATCH 2/7] perf: remove redundant pmu assignment Mark Rutland
2014-02-27 13:33 ` [tip:perf/core] perf: Remove redundant PMU assignment tip-bot for Mark Rutland
2014-02-10 17:44 ` [PATCH 3/7] perf: kill perf_event_context_type Mark Rutland
2014-02-25 11:38 ` Peter Zijlstra
2014-02-27 11:46 ` Mark Rutland
2014-02-10 17:44 ` [PATCH 4/7] perf: be less pessimistic when scheduling events Mark Rutland
2014-02-10 17:58 ` Peter Zijlstra
2014-02-11 17:48 ` Mark Rutland
2014-02-25 11:29 ` Peter Zijlstra
2014-02-27 12:07 ` Mark Rutland
2014-02-10 17:44 ` [PATCH 5/7] perf: kill pmu::hrtimer_interval_ms Mark Rutland
2014-02-10 17:44 ` [PATCH 6/7] perf: Centralise context pmu disabling Mark Rutland
2014-02-10 18:08 ` Peter Zijlstra
2014-02-10 17:44 ` [PATCH 7/7] perf: kill perf_event_context::pmu Mark Rutland
2014-02-10 18:10 ` Peter Zijlstra
2014-02-11 17:56 ` Mark Rutland
2014-02-12 15:01 ` Dave Martin
2014-02-25 11:31 ` Peter Zijlstra
2014-02-27 11:48 ` Mark Rutland
2014-02-27 11:51 ` Peter Zijlstra
2014-02-27 12:30 ` Mark Rutland [this message]
2014-02-19 13:43 ` [PATCH 0/7] Perf core cleanups for shared perf_event_contexts Mark Rutland
2014-02-25 11:39 ` 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=20140227123035.GA8647@e106331-lin.cambridge.arm.com \
--to=mark.rutland@arm.com \
--cc=Dave.Martin@arm.com \
--cc=Will.Deacon@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--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 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®