lkml.org 
[lkml]   [2015]   [Oct]   [19]   [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 Mon, Oct 19, 2015 at 12:58:47AM -0700, Stephane Eranian wrote:
> Peter,
>
> On Sat, Oct 17, 2015 at 2:56 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > 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.
> >
> I am assuming that is the checker detects something suspicious there is likely
> a problem.
>
> Take for instance:
> perf_cgroup_sched_out()->perf_cgroup_from_task() ->task_subsys_state()
>
> That one fires the checker. I think because we are accessing the css
> state without
> protection.
>
> The other places are similar.

But perf_cgroup_attach()->perf_cgroup_switch() takes ctx->lock().

Therefore; if you hold ctx->lock, the cgroup is pinned.

And the above sequence very much holds ctx->lock.

Right?

So it looks to me that we should teach perf_cgroup_from_task() about
ctx->lock or something.


\
 
 \ /
  Last update: 2015-10-19 11:41    [W:0.062 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site