lkml.org 
[lkml]   [2015]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf/core: fix RCU issues with cgroup monitoring mode
On Sat, Oct 17, 2015 at 03:28:11AM +0200, Stephane Eranian wrote:
>
> This patch eliminates all known RCU violations detected
> by the RCU checker (PROVE_RCU). The impact code paths
> were all related to cgroup mode monitoring and involved
> access a task's cgrp.

But were they right? This patch provides no clues.

> Signed-off-by: Stephane Eranian <eranian@google.com>
> ---

> @@ -2094,6 +2104,7 @@ static int __perf_install_in_context(void *info)
> cpuctx->task_ctx = task_ctx;
> task = task_ctx->task;
> }
> + rcu_read_lock();
>
> cpu_ctx_sched_out(cpuctx, EVENT_ALL);
>
> @@ -2112,6 +2123,8 @@ static int __perf_install_in_context(void *info)
> */
> perf_event_sched_in(cpuctx, task_ctx, task);
>
> + rcu_read_unlock();
> +
> perf_pmu_enable(cpuctx->ctx.pmu);
> perf_ctx_unlock(cpuctx, task_ctx);
>
> @@ -2398,7 +2411,9 @@ static void ctx_sched_out(struct perf_event_context *ctx,
> return;
>
> update_context_time(ctx);
> + rcu_read_lock();
> update_cgrp_time_from_cpuctx(cpuctx);
> + rcu_read_unlock();
> if (!ctx->nr_active)
> return;
>

And these impact !cgroup code, and the last looks like it should be
inside update_cgrp_time_from_cpuctx() if at all.


\
 
 \ /
  Last update: 2015-10-17 12:21    [W:0.134 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site