Received: by 10.223.185.116 with SMTP id b49csp5281487wrg; Wed, 7 Mar 2018 09:09:33 -0800 (PST) X-Google-Smtp-Source: AG47ELsiSfPgH/J1x9VMppemLILxkfVjhJ8MAsYg2l+lVv74OfLTeOrcowFqTCPYISWO/NSo0rgt X-Received: by 10.99.114.86 with SMTP id c22mr18247564pgn.162.1520442573524; Wed, 07 Mar 2018 09:09:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520442573; cv=none; d=google.com; s=arc-20160816; b=HfH9tcEBYp1Wbi1JLMlsYKPB3xvL3PmNpLT1fOKBrNhtwU+pVpp93H86uV0qJuVw1j +7M0HopOTrIe9aimWcqPcVkVLMaYEaPp/ki6VY9uY/6rJVZN+Xzostk+ub/DnQMevwNM /OHQ2Jy/IShPxUuEz64hWXs3AAi62VaszFxvpOXvpir/TRzElfiXxNhm7lTGNnvXjIgU pKtsfpyRcel60/53wyKFlK8zdKI+9+EQTw1orgZk8yyE8z1sspcFNNg7nEkpibrQgBre 47UYxaS5ObunAwUFvuNXSGifEMA0lXLWUXsEjZ1r693+L70SuWJR6ug0aVU+AUuIa5jI PtUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=SJD39mkmOJHQZO8nvZcgoj5erZ8IZ42vdgluyePGLBk=; b=KhSQVvhD4NcNeyVf5jdbb8d6csdHguScAyEa35TudrrNaJ0t92kuDJWyM1udLPh8RM W42tWFrops5c23lXLOzqlxXN5N3ch+Yf53GDMSSb9rgjTmYiTLs5u1mbC6kkGdqCCcPI zNckxVR7IcTeSEZJF3YSn9CiRMr7hoJt05IfwaxQSHbMrUux5l6zZe/ZSAdI/9S6nrY7 5iHHpdyQQz2BErHosyK6BKNwc+TBanNH1gx2q3ZbW/1yQuAPZvRZNaNfltNl6Vwv8iun xIn2VqYERsVlYeeCzg0tbd6NsKGZwvxEwZW2X0sze0hYo8C6i+LdaDzWN4lJgDMISLuj Uqfw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v10si11621265pgs.164.2018.03.07.09.09.18; Wed, 07 Mar 2018 09:09:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934134AbeCGRHa (ORCPT + 99 others); Wed, 7 Mar 2018 12:07:30 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:36796 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933533AbeCGRH0 (ORCPT ); Wed, 7 Mar 2018 12:07:26 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w27GxLc8130021 for ; Wed, 7 Mar 2018 12:07:26 -0500 Received: from e13.ny.us.ibm.com (e13.ny.us.ibm.com [129.33.205.203]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gjkd22aqc-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Wed, 07 Mar 2018 12:07:25 -0500 Received: from localhost by e13.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 7 Mar 2018 12:07:23 -0500 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e13.ny.us.ibm.com (146.89.104.200) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 7 Mar 2018 12:07:20 -0500 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w27H7JwF37355630; Wed, 7 Mar 2018 17:07:19 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D2E5BB2056; Wed, 7 Mar 2018 13:09:34 -0500 (EST) Received: from paulmck-ThinkPad-W541 (unknown [9.80.193.224]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 86B12B204D; Wed, 7 Mar 2018 13:09:34 -0500 (EST) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 8799816C175D; Wed, 7 Mar 2018 07:54:44 -0800 (PST) Date: Wed, 7 Mar 2018 07:54:44 -0800 From: "Paul E. McKenney" To: Ingo Molnar Cc: "Eric W. Biederman" , Linus Torvalds , Tejun Heo , Jann Horn , Benjamin LaHaise , Al Viro , Thomas Gleixner , Peter Zijlstra , linux-kernel@vger.kernel.org Subject: Re: Simplifying our RCU models Reply-To: paulmck@linux.vnet.ibm.com References: <20180305001600.GO3918@linux.vnet.ibm.com> <20180305030949.GP3918@linux.vnet.ibm.com> <20180305082441.4hao2z4dqn2n5on6@gmail.com> <87po4izj67.fsf_-_@xmission.com> <20180305161446.GQ3918@linux.vnet.ibm.com> <20180306084738.tcs4ggbby77phlbh@gmail.com> <20180306203906.GA3918@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180306203906.GA3918@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18030717-0008-0000-0000-000002E0DCD7 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008629; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.00999654; UDB=6.00508493; IPR=6.00779060; MB=3.00019896; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-07 17:07:22 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18030717-0009-0000-0000-0000387D2286 Message-Id: <20180307155444.GA10367@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-07_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803070195 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 06, 2018 at 12:39:06PM -0800, Paul E. McKenney wrote: > On Tue, Mar 06, 2018 at 09:47:38AM +0100, Ingo Molnar wrote: > > > > * Paul E. McKenney wrote: > > > > > > > But if we look at the bigger API picture: > > > > > > > > > > !PREEMPT_RCU PREEMPT_RCU=y > > > > > rcu_read_lock(): atomic preemptible > > > > > rcu_read_lock_sched(): atomic atomic > > > > > srcu_read_lock(): preemptible preemptible > > > > > > > > > > Then we could maintain full read side API flexibility by making PREEMPT_RCU=y the > > > > > only model, merging it with SRCU and using these main read side APIs: > > > > > > > > > > rcu_read_lock_preempt_disable(): atomic > > > > > rcu_read_lock(): preemptible > > > > > > One issue with merging SRCU into rcu_read_lock() is the general blocking within > > > SRCU readers. Once merged in, these guys block everyone. We should focus > > > initially on the non-SRCU variants. > > > > > > On the other hand, Linus's suggestion of merging rcu_read_lock_sched() > > > into rcu_read_lock() just might be feasible. If that really does pan > > > out, we end up with the following: > > > > > > !PREEMPT PREEMPT=y > > > rcu_read_lock(): atomic preemptible > > > srcu_read_lock(): preemptible preemptible > > > > > > In this model, rcu_read_lock_sched() maps to preempt_disable() and (as > > > you say above) rcu_read_lock_bh() maps to local_bh_disable(). The way > > > this works is that in PREEMPT=y kernels, synchronize_rcu() waits not > > > only for RCU read-side critical sections, but also for regions of code > > > with preemption disabled. The main caveat seems to be that there be an > > > assumed point of preemptibility between each interrupt and each softirq > > > handler, which should be OK. > > > > > > There will be some adjustments required for lockdep-RCU, but that should > > > be reasonably straightforward. > > > > > > Seem reasonable? > > > > Yes, that approach sounds very reasonable to me: it is similar to what we do on > > the locking side as well, where we have 'atomic' variants (spinlocks/rwlocks) and > > 'sleeping' variants (mutexes, rwsems, etc.). > > > > ( This means there will be more automatic coupling between BH and preempt critical > > sections and RCU models not captured via explicit RCU-namespace APIs, but that > > should be OK I think. ) > > Thus far, I have been unable to prove that it cannot work, which is about > as good as it gets at this stage. So here is hoping! ;-) > > I will look at your later corrected message, but will gratefully accept > your offer of help with the naming transition. Ah, and any thoughts on how best to get feedback from the various people who would need to reprogram their fingers? Or is everyone already on board with changing these various names? Thanx, Paul