[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BD04AF0D5BE72443A0B69C1C0486AD3ECE8DA82C@exchdb03.mips.com>
Date: Tue, 22 Nov 2011 13:24:19 +0000
From: "Zhu, DengCheng" <dczhu@...s.com>
To: Peter Zijlstra <a.p.zijlstra@...llo.nl>
CC: "Barzilay, Eyal" <eyal@...s.com>,
"Fortuna, Zenon" <zenon@...s.com>,
Paul Mackerras <paulus@...ba.org>, Ingo Molnar <mingo@...e.hu>,
Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
"ralf@...ux-mips.org" <ralf@...ux-mips.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v2 5/5] perf: Enable applicable siblings when group
leader is enable-on-exec
> ________________________________________
> From: Peter Zijlstra [a.p.zijlstra@...llo.nl]
> Sent: Tuesday, November 22, 2011 6:51 PM
> To: Zhu, DengCheng
> Cc: Barzilay, Eyal; Fortuna, Zenon; Paul Mackerras; Ingo Molnar; Arnaldo Carvalho de Melo; ralf@...ux-mips.org; LKML
> Subject: Re: [PATCH v2 5/5] perf: Enable applicable siblings when group leader is enable-on-exec
>
> On Tue, 2011-11-22 at 11:30 +0800, Deng-Cheng Zhu wrote:
>> Currently, when grouped events are created disabled and enable-on-exec, the
>> siblings won't be enabled on exec in fact. The problem looks like this:
>
> Arguably that's a daft thing to do, since if the leader is disabled the
> group won't get scheduled anyway. But I guess we should at least try to
> deal with it when people do do it.
Well, by "grouped events" I mean "all of the grouped events", not only the
group leader. In fact the leader (and only the leader) will be enabled by
going through ctx->flexible_groups in perf_event_enable_on_exec().
>
> Seems perf-stat is a bit daft this way.
>
>> This patch fixes it.
>
> I guess it does, but its not pretty, event_enable_on_exec() already
> calls __perf_event_mark_enable(), now this recursion is limited because
> siblings can't have a sibling list of their own, but still.
I did it like this just by reading the code comment of
__perf_event_mark_enabled(): "Enabling the leader of a group effectively
enables all the group members that aren't explicitly disabled ... Note:
this works for group members as well as group leaders since the non-leader
members' sibling_lists will be empty."
So I suppose dealing with siblings' state in this traversal is the right
thing to do and introduces minimal code turmoil, although the latter is by
no means critical.
> The below is a somewhat larger patch that avoids the recursion (and does
> a small cleanup by eradicating all those useless ctx arguments). Quick
> testing seems to indicate it works, but please confirm.
I have no objection of deleting the redundant ctx arguments, but that's
another topic.
Deng-Cheng
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists