Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1561692

Re: [PATCH 1/2] perf/core: Make cgroup switch visit only cpuctxs with cgroup events

From Mark Rutland <mark.rutland@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] perf/core: Make cgroup switch visit only cpuctxs with cgroup events
Date 2017-01-18 13:20 +0100
Message-ID <t0XnA-3ZK-21@gated-at.bofh.it> (permalink)
References <t0G3n-1zz-1@gated-at.bofh.it> <t0G3n-1zz-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Jan 17, 2017 at 09:38:39AM -0800, David Carrillo-Cisneros wrote:
> This is a low-hanging fruit optimization. It replaces the iteration over
> the "pmus" list in cgroup switch by an iteration over a new list that
> contains only cpuctxs with at least one cgroup event.
> 
> This is necessary because the number of pmus have increased over the years
> e.g modern x86 server systems have well above 50 pmus.
> The iteration over the full pmu list is unneccessary and can be costly in
> heavy cache contention scenarios.

While I haven't done any measurement of the overhead, this looks like a
nice rework/cleanup.

Since this is only changing the management of cpu contexts, this
shouldn't adversely affect systems with heterogeneous CPUs. I've also
given this a spin on such a system, to no ill effect.

I have one (very minor) comment below, but either way:

Acked-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Mark Rutland <mark.rutland@arm.com>

> @@ -889,6 +876,7 @@ list_update_cgroup_event(struct perf_event *event,
>  			 struct perf_event_context *ctx, bool add)
>  {
>  	struct perf_cpu_context *cpuctx;
> +	struct list_head *lentry;

It might be worth calling this cpuctx_entry, so that it's clear which
list element it refers to. I can imagine we'll add more list
manipulation in this path in future.

Thanks,
Mark.

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] Optimize cgroup ctx switch and remove cpuctx->unique_pmu David Carrillo-Cisneros <davidcc@google.com> - 2017-01-17 18:50 +0100
  [PATCH 2/2] perf/core: Remove perf_cpu_context::unique_pmu David Carrillo-Cisneros <davidcc@google.com> - 2017-01-17 18:50 +0100
    Re: [PATCH 2/2] perf/core: Remove perf_cpu_context::unique_pmu Mark Rutland <mark.rutland@arm.com> - 2017-01-18 13:30 +0100
  [PATCH 1/2] perf/core: Make cgroup switch visit only cpuctxs with cgroup events David Carrillo-Cisneros <davidcc@google.com> - 2017-01-17 18:50 +0100
    Re: [PATCH 1/2] perf/core: Make cgroup switch visit only cpuctxs  with cgroup events Mark Rutland <mark.rutland@arm.com> - 2017-01-18 13:20 +0100
      Re: [PATCH 1/2] perf/core: Make cgroup switch visit only cpuctxs with  cgroup events David Carrillo-Cisneros <davidcc@google.com> - 2017-01-18 20:30 +0100

csiph-web