Re: [PATCH 3/4] perf cgroup: Add cgroup ID as a key of RB tree

2019-04-30 Thread Liang, Kan
On 4/30/2019 5:08 AM, Peter Zijlstra wrote: On Mon, Apr 29, 2019 at 04:02:33PM -0700, Ian Rogers wrote: This is very interesting. How does the code handle cgroup hierarchies? For example, if we have: cgroup0 is the cgroup root cgroup1 whose parent is cgroup0 cgroup2 whose parent is cgroup1

Re: [PATCH 3/4] perf cgroup: Add cgroup ID as a key of RB tree

2019-04-30 Thread Liang, Kan
On 4/30/2019 5:03 AM, Peter Zijlstra wrote: On Mon, Apr 29, 2019 at 07:44:04AM -0700, kan.li...@linux.intel.com wrote: Add unique cgrp_id for each cgroup, which is composed by CPU ID and css subsys-unique ID. *WHY* ?! that doesn't make any kind of sense.. In fact you mostly then use the

Re: [PATCH 3/4] perf cgroup: Add cgroup ID as a key of RB tree

2019-04-30 Thread Peter Zijlstra
A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? On Mon, Apr 29, 2019 at 04:02:33PM -0700, Ian Rogers wrote: > This is very interesting. How does the code handle cgroup

Re: [PATCH 3/4] perf cgroup: Add cgroup ID as a key of RB tree

2019-04-30 Thread Peter Zijlstra
On Mon, Apr 29, 2019 at 07:44:04AM -0700, kan.li...@linux.intel.com wrote: > +static struct perf_event * > +perf_event_groups_first_cgroup(struct perf_event_groups *groups, > +int cpu, u64 cgrp_id) > +{ > + struct perf_event *node_event = NULL, *match = NULL; > +

Re: [PATCH 3/4] perf cgroup: Add cgroup ID as a key of RB tree

2019-04-30 Thread Peter Zijlstra
On Mon, Apr 29, 2019 at 07:44:04AM -0700, kan.li...@linux.intel.com wrote: > Add unique cgrp_id for each cgroup, which is composed by CPU ID and css > subsys-unique ID. *WHY* ?! that doesn't make any kind of sense.. In fact you mostly then use the low word because most everything is already per

Re: [PATCH 3/4] perf cgroup: Add cgroup ID as a key of RB tree

2019-04-29 Thread Ian Rogers
This is very interesting. How does the code handle cgroup hierarchies? For example, if we have: cgroup0 is the cgroup root cgroup1 whose parent is cgroup0 cgroup2 whose parent is cgroup1 we have task0 running in cgroup0, task1 in cgroup1, task2 in cgroup2 and then a perf command line like: perf

[PATCH 3/4] perf cgroup: Add cgroup ID as a key of RB tree

2019-04-29 Thread kan . liang
From: Kan Liang Current RB tree for pinned/flexible groups doesn't take cgroup into account. All events on a given CPU will be fed to pinned/flexible_sched_in(), which relies on perf_cgroup_match() to filter the events for a specific cgroup. The method has high overhead, especially in frequent