[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1322048382.14799.41.camel@twins>
Date: Wed, 23 Nov 2011 12:39:42 +0100
From: Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: Deng-Cheng Zhu <dczhu@...s.com>
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
On Wed, 2011-11-23 at 11:38 +0800, Deng-Cheng Zhu wrote:
> + list_for_each_entry_rcu(event, &ctx->event_list, event_entry) {
> + ret = event_enable_on_exec(event, ctx);
> + if (ret)
> + enabled = 1;
> + }
> +
> list_for_each_entry(event, &ctx->pinned_groups, group_entry) {
> ret = event_enable_on_exec(event, ctx);
> if (ret)
This isn't correct either, in this case you should then remove the other
two iterations of pinned/flexible group lists.
Also your use of list_for_each_entry_rcu() is incorrect, either you then
should also use rcu_read_lock(), or its not needed and not use the _rcu
list primitive at all.
Now since event_list is modified under ctx->lock, and we hold that lock
no fancy stuff is needed and we can do without.
---
Subject: perf: Fix enable_on_exec for sibling events
From: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Date: Tue Nov 22 11:25:43 CET 2011
Deng-Cheng Zhu reported that sibling events that were created disabled
with enable_on_exec would never get enabled. Iterate all events instead
of the group lists.
Reported-by: Deng-Cheng Zhu <dczhu@...s.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Link: http://lkml.kernel.org/n/tip-299rxrpmmle8hp3spyxfo202@git.kernel.org
---
kernel/events/core.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
Index: linux-2.6/kernel/events/core.c
===================================================================
--- linux-2.6.orig/kernel/events/core.c
+++ linux-2.6/kernel/events/core.c
@@ -2494,13 +2494,7 @@ static void perf_event_enable_on_exec(st
raw_spin_lock(&ctx->lock);
task_ctx_sched_out(ctx);
- list_for_each_entry(event, &ctx->pinned_groups, group_entry) {
- ret = event_enable_on_exec(event, ctx);
- if (ret)
- enabled = 1;
- }
-
- list_for_each_entry(event, &ctx->flexible_groups, group_entry) {
+ list_for_each_entry(event, &ctx->event_list, group_entry) {
ret = event_enable_on_exec(event, ctx);
if (ret)
enabled = 1;
--
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