[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 9 Sep 2014 12:20:00 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Jiri Olsa <jolsa@...hat.com>
Cc: Jiri Olsa <jolsa@...nel.org>, linux-kernel@...r.kernel.org,
Andi Kleen <andi@...stfloor.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
David Ahern <dsahern@...il.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Ingo Molnar <mingo@...nel.org>,
"Jen-Cheng(Tommy) Huang" <tommy24@...ech.edu>,
Namhyung Kim <namhyung@...nel.org>,
Paul Mackerras <paulus@...ba.org>,
Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 1/9] perf: Remove redundant parent context check from
context_equiv
On Mon, Sep 08, 2014 at 06:45:24PM +0200, Jiri Olsa wrote:
> I just noticed that we initialize the child state with base parent
> state not the real (immediate) parent.. which is what we want IMO
>
> I wonder attached patch could fix the issue mentioned in:
> 1f9a726 perf: Do not allow optimized switch for non-cloned events
>
> now I need to recall what I used to test this ;-)
Ah, very nice! Yes this might just do it.
> ---
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index e4d6924..561a4ea 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -7794,6 +7794,7 @@ inherit_event(struct perf_event *parent_event,
> struct perf_event *group_leader,
> struct perf_event_context *child_ctx)
> {
> + enum perf_event_active_state parent_state = parent_event->state;
> struct perf_event *child_event;
> unsigned long flags;
>
> @@ -7827,7 +7828,7 @@ inherit_event(struct perf_event *parent_event,
> * not its attr.disabled bit. We hold the parent's mutex,
> * so we won't race with perf_event_{en, dis}able_family.
> */
> - if (parent_event->state >= PERF_EVENT_STATE_INACTIVE)
> + if (parent_state >= PERF_EVENT_STATE_INACTIVE)
> child_event->state = PERF_EVENT_STATE_INACTIVE;
> else
> child_event->state = PERF_EVENT_STATE_OFF;
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists