From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760797AbcBYPhb (ORCPT ); Thu, 25 Feb 2016 10:37:31 -0500 Received: from e33.co.us.ibm.com ([32.97.110.151]:60763 "EHLO e33.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760202AbcBYPha (ORCPT ); Thu, 25 Feb 2016 10:37:30 -0500 X-IBM-Helo: d03dlp03.boulder.ibm.com X-IBM-MailFrom: paulmck@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Date: Thu, 25 Feb 2016 07:37:24 -0800 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Boqun Feng , linux-kernel@vger.kernel.org, Ingo Molnar , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , sasha.levin@oracle.com Subject: Re: [RFC v2 0/6] Track RCU dereferences in RCU read-side critical sections Message-ID: <20160225153724.GL3522@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <1455602265-16490-1-git-send-email-boqun.feng@gmail.com> <20160225143243.GP6357@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160225143243.GP6357@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16022515-0009-0000-0000-000012BA0841 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 25, 2016 at 03:32:43PM +0100, Peter Zijlstra wrote: > On Tue, Feb 16, 2016 at 01:57:39PM +0800, Boqun Feng wrote: > > As a characteristic of RCU, read-side critical sections have a very > > loose connection with rcu_dereference()s, which is you can only be sure > > about an rcu_dereference() might be called in some read-side critical > > section, but if code gets complex, you may not be sure which read-side > > critical section exactly, this might be also an problem for some other > > locking mechanisms, that is the critical sections protecting data and > > the data accesses protected are not clearly correlated. > > > > In this series, we are introducing LOCKED_ACCESS framework and based on > > which, we implement the RCU_LOCKED_ACCESS functionality to give us a > > clear hint: which rcu_dereference() happens in which RCU read-side > > critical section. > > > > After this series applied, and if CONFIG_RCU_LOCKED_ACCESS=y, the proc > > file /proc/locked_access/rcu will show all relationships collected so > > far for rcu_read_lock() and their friends and rcu_dereference*(). > > But why !? What does this bring us, why do I want to even look at these > patches? There were some complaints about the difficulty of figuring out what was being protected by a given rcu_read_lock() in cases where the corresponding rcu_dereference() is several function calls down, and especially in cases where the function calls are via pointers. These cases show up in a number of places, perhaps most prominently in networking. Boqun's patches therefore use lockdep to make an association between each rcu_dereference() and the rcu_read_lock() protecting it. Seem reasonable, or were the complaints just a flash in the pan? Thanx, Paul