diff options
author | Ian Rogers <irogers@google.com> | 2020-02-13 23:51:33 -0800 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2020-03-06 11:57:01 +0100 |
commit | 95ed6c707f26a727a29972b60469630ae10d579c (patch) | |
tree | 51f7dd9dc333d8e486d477e11f7110335c3d3781 /mm/mlock.c | |
parent | c2283c9368d41063f2077cb58def02217360526d (diff) |
perf/cgroup: Order events in RB tree by cgroup id
If one is monitoring 6 events on 20 cgroups the per-CPU RB tree will
hold 120 events. The scheduling in of the events currently iterates
over all events looking to see which events match the task's cgroup or
its cgroup hierarchy. If a task is in 1 cgroup with 6 events, then 114
events are considered unnecessarily.
This change orders events in the RB tree by cgroup id if it is present.
This means scheduling in may go directly to events associated with the
task's cgroup if one is present. The per-CPU iterator storage in
visit_groups_merge is sized sufficent for an iterator per cgroup depth,
where different iterators are needed for the task's cgroup and parent
cgroups. By considering the set of iterators when visiting, the lowest
group_index event may be selected and the insertion order group_index
property is maintained. This also allows event rotation to function
correctly, as although events are grouped into a cgroup, rotation always
selects the lowest group_index event to rotate (delete/insert into the
tree) and the min heap of iterators make it so that the group_index order
is maintained.
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lkml.kernel.org/r/20190724223746.153620-3-irogers@google.com
Diffstat (limited to 'mm/mlock.c')
0 files changed, 0 insertions, 0 deletions