[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180212094406.GE5821@krava>
Date: Mon, 12 Feb 2018 10:44:06 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: Raghavendra Rao Ananta <rananta@...eaurora.org>
Cc: peterz@...radead.org, mingo@...hat.com, acme@...nel.org,
alexander.shishkin@...ux.intel.com, namhyung@...nel.org,
linux-kernel@...r.kernel.org, psodagud@...eaurora.org,
tsoni@...eaurora.org
Subject: Re: [PATCH] perf: Add support for creating offline events
On Fri, Feb 09, 2018 at 03:07:00PM -0800, Raghavendra Rao Ananta wrote:
SNIP
>
> if (!task) {
> +#if defined CONFIG_HOTPLUG_CPU || defined CONFIG_KEXEC_CORE
> + struct perf_cpu_context *cpuctx =
> + container_of(ctx, struct perf_cpu_context, ctx);
> +
> + if (!cpuctx->online) {
> + perf_prepare_install_in_context(event);
> + return;
> + }
> +#endif
> cpu_function_call(cpu, __perf_install_in_context, event);
> return;
> }
> @@ -2421,6 +2443,43 @@ static int __perf_install_in_context(void *info)
> raw_spin_unlock_irq(&ctx->lock);
> }
>
> +#if defined CONFIG_HOTPLUG_CPU || defined CONFIG_KEXEC_CORE
> +static void perf_deferred_install_in_context(int cpu)
> +{
> + struct perf_event *event, *tmp;
> + struct perf_event_context *ctx;
> +
> + /* This function is called twice while coming online. Once for
> + * CPUHP_PERF_PREPARE and the other for CPUHP_AP_PERF_ONLINE.
> + * Only during the CPUHP_AP_PERF_ONLINE state, we can confirm
> + * that CPU PMU is ready and can be installed to.
> + */
> + if (!cpu_online(cpu))
> + return;
> +
> + spin_lock(&dormant_event_list_lock);
> + list_for_each_entry_safe(event, tmp, &dormant_event_list,
> + dormant_entry) {
> + if (cpu != event->cpu)
> + continue;
I wonder having per cpu lists would be better here,
could be quite busy for big number of CPUs
jirka
Powered by blists - more mailing lists