lkml.org 
[lkml]   [2009]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] perf_counter: cleanup for __perf_event_sched_in()
From
Date
On Tue, 2009-09-22 at 19:39 +1000, Paul Mackerras wrote:
> 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?

/me kicks those neurons back to work..

Ah, yes, I think you're right, the second hunk of afedadf2 is a
pessimisation due to the extra branch.




\
 
 \ /
  Last update: 2009-09-22 13:19    [W:0.250 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site