[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1253695389.7695.124.camel@twins>
Date: Wed, 23 Sep 2009 10:43:09 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Xiao Guangrong <xiaoguangrong@...fujitsu.com>
Cc: Ingo Molnar <mingo@...e.hu>, Paul Mackerras <paulus@...ba.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] perf_counter: optimize for perf_event_init_task()
On Wed, 2009-09-23 at 16:13 +0800, Xiao Guangrong wrote:
> We can traverse ctx->group_list to get all group leader, it should be safe
> since we hold ctx->mutex
I don't think we need that WARN_ON_ONCE there.
> Signed-off-by: Xiao Guangrong <xiaoguangrong@...fujitsu.com>
> ---
> kernel/perf_event.c | 5 ++---
> 1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/perf_event.c b/kernel/perf_event.c
> index 9ca975a..4e6e822 100644
> --- a/kernel/perf_event.c
> +++ b/kernel/perf_event.c
> @@ -4786,9 +4786,8 @@ int perf_event_init_task(struct task_struct *child)
> * We dont have to disable NMIs - we are only looking at
> * the list, not manipulating it:
> */
> - list_for_each_entry_rcu(event, &parent_ctx->event_list, event_entry) {
> - if (event != event->group_leader)
> - continue;
> + list_for_each_entry(event, &parent_ctx->group_list, group_entry) {
> + WARN_ON_ONCE(event != event->group_leader);
>
> if (!event->attr.inherit) {
> inherited_all = 0;
--
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