Messages in this thread |  | | Date | Mon, 18 Nov 2019 09:37:33 +0100 | From | Peter Zijlstra <> | Subject | Re: [PATCH v3 08/10] perf: cache perf_event_groups_first for cgroups |
| |
On Fri, Nov 15, 2019 at 05:20:52PM -0800, Ian Rogers wrote: > On Thu, Nov 14, 2019 at 2:25 AM Peter Zijlstra <peterz@infradead.org> wrote:
> > > @@ -1706,18 +1738,10 @@ perf_event_groups_first(struct perf_event_groups *groups, int cpu, > > > continue; > > > } > > > #ifdef CONFIG_CGROUP_PERF > > > - node_cgrp_id = 0; > > > - if (node_event->cgrp && node_event->cgrp->css.cgroup) > > > - node_cgrp_id = node_event->cgrp->css.cgroup->id; > > > - > > > - if (cgrp_id < node_cgrp_id) { > > > + if (node_event->cgrp) { > > > node = node->rb_left; > > > continue; > > > } > > > - if (cgrp_id > node_cgrp_id) { > > > - node = node->rb_right; > > > - continue; > > > - } > > > #endif > > > match = node_event; > > > node = node->rb_left; > > > > Also, just leave that in and let callers have: .cgrp = NULL. Then you > > can forgo that monstrous name. > > Done. It is a shame that there is some extra logic for the task/no-cgroup case.
Yes, OTOH the primitive is consistent and more generic and possibly the compiler will notice and fix it for us, it is a static function after all, so it can be more agressive.
|  |