Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030543AbbKDPxj (ORCPT ); Wed, 4 Nov 2015 10:53:39 -0500 Received: from casper.infradead.org ([85.118.1.10]:53688 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030281AbbKDPxi (ORCPT ); Wed, 4 Nov 2015 10:53:38 -0500 Date: Wed, 4 Nov 2015 16:53:34 +0100 From: Peter Zijlstra To: Stephane Eranian Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, ak@linux.intel.com, edumazet@google.com, acme@redhat.com Subject: Re: [PATCH v3] perf: fix RCU issues with cgroup monitoring mode Message-ID: <20151104155334.GM17308@twins.programming.kicks-ass.net> References: <20151104041219.GA12969@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151104041219.GA12969@thinkpad> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1744 Lines: 38 On Wed, Nov 04, 2015 at 05:12:19AM +0100, Stephane Eranian wrote: > > This patch eliminates 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. > > V2 is updated to include comments from PeterZ to eliminate > some of the warnings without grabbing the rcu_read lock because > we know we are already holding th ctx->lock which prevents > the cgroup from disappearing while we are accessing it. > The trick, as suggested by Peter, is to modify the > perf_cgroup_from_task() to take an extra boolean parameter > to allow bypassing the lockdep test in the task_subsys_cstate() > macros. This patch uses this approach to update all calls the > perf_cgroup_from_task(). > > In V3, we change the boolean parameter for a pointer to a > perf_event_context so we can check the ctx->lock explicitely. > This is more robust, than passing the boolean to express that > we know the lock is held. The code can change, and thus the > locking assumption, checking lockdep_is_held() ensures, > the proper locking is in place. Patch relative to tip.git > at commit 57ef9fc. So aside from the reported build fails; this is not suitable Changelog. Also, please split it at least two patches; as there are at least the two distinct issues here. One is the perf_cgroup_sched_{in,out} thing, which requires moving the rcu_read_lock bits around, the other is the timestamp bits which require the ctx argument. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/