lkml.org 
[lkml]   [2019]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2019-11-18 09:38    [W:0.068 / U:6.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site