Re: [PATCH] perf_counter: cleanup for __perf_event_sched_in()

From: Paul Mackerras
Date: Tue Sep 22 2009 - 05:39:47 EST


Xiao Guangrong writes:

> It must be a group leader if event->attr.pinned is "1"

Actually, looking at this more closely, it has to be a group leader
anyway since it's at the top level of ctx->group_list. In fact I see
four places where we do:

list_for_each_entry(event, &ctx->group_list, group_entry) {
if (event == event->group_leader)
...

or the equivalent, three of which appear to have been introduced by
afedadf2 ("perf_counter: Optimize sched in/out of counters") back in
May by Peter Z.

As far as I can see the if () is superfluous in each case (a singleton
event will be a group of 1 and will have its group_leader pointing to
itself). Peter, do you agree or have I missed something?

Paul.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/