Received: by 10.223.185.116 with SMTP id b49csp86650wrg; Thu, 8 Mar 2018 13:21:09 -0800 (PST) X-Google-Smtp-Source: AG47ELv+HBMrz/U1vUKpEpUlyPfHextdn794dLH7QDPsqdnWCoKPXJB1OJUlGbFcWiQ2oo9ODb5W X-Received: by 10.101.83.3 with SMTP id m3mr3058905pgq.197.1520544069542; Thu, 08 Mar 2018 13:21:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520544069; cv=none; d=google.com; s=arc-20160816; b=YEhjtyxt03XBF07o5/gLFOOElfxdrowEXyrPniv2YLNlwSzQAcWB/AtQH8qIFYHfUD ugEuLW4MqHF68sLTCJ1sSEarxm2zxoB4LSzWMDHramvxZms1N/y/+Y6CQbOcQrFvLKr4 YtvAXaCz0JHfjbTMOYbQ9gEE7hTnkT4cufsKQiZPJBQS4DNDGaHstqrjRv/Pw7EPn6Sb wjaQgqy6bgkQKd3m2HQ4s+lbgQtXJuZeP9Vq1SRsuIxQedWAthwBnKufWY3ECnhlY2/K x9sKt1enaN1GmhjuN0H29ZqvA2vYyqbZVQvv0yLOJXmmeV8f+8KAis45bcwyo5MxJna4 PcaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=mC4eKi+EXWoZRPrfUV1N8glp79RifPQr7qoE1+SIxKc=; b=TUuQEYKxQaRSGs/V+1ApaWtA1Lyz8ISeTgpMt9Q0BzpgVM2QlrdcZRhb98/jrTeZoq rw6+aYY+1iCwZnhVJovUpEtCKeaIo7oaVYaW4ptmY7HzgyROljonitIaokJznGZVZ4Tg rgsNccCasfbPpzDwCWL4Er3GDR5J8SMdVBznpOc11I7VCppGYcEFtfEl9SK3G4kWttJP 1LV/EIJATM19bO/0jtD0x/t/N14Wc6a++lXmCqman/RwZbJsa231AGn3T9Dp1dsARiwF g0BWksWMNXn7WDycXfqnNtDg77clNN07Bht5Cle+Y38MmRsc+QhMh0lDiH2GWOHd7THT fguQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GuRuhK03; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i5si13591996pgc.521.2018.03.08.13.20.54; Thu, 08 Mar 2018 13:21:09 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GuRuhK03; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751045AbeCHVUA (ORCPT + 99 others); Thu, 8 Mar 2018 16:20:00 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:50328 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750909AbeCHVT6 (ORCPT ); Thu, 8 Mar 2018 16:19:58 -0500 Received: by mail-wm0-f66.google.com with SMTP id w128so423724wmw.0 for ; Thu, 08 Mar 2018 13:19:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mC4eKi+EXWoZRPrfUV1N8glp79RifPQr7qoE1+SIxKc=; b=GuRuhK0344ukTsURXCGtutk8fQOmbynDDx1UvbIFbS1Dq58d4mpA3kqQrqmHc5ccmC qVx4uLehoGorU2MkVilFt1vhCyBOIUXXnDs5gBUJ83Rgw4rjVrbGdGcb9L9nm+RXrlhA ozQFagY/jD5feFHmLxismJ3UpDFKlMNaW2XmMfUzBqcgEmJGZt0jvQm8LmN1Vfm4EfY/ mZV/vf46tyGNErBld37lf+PuPTf2/e61SIbu7Nwcg8o9AAkQSNyetS7bc3zOrJ5NRNuq AkApssjGJNl+ZTsb91zo+rDYB2JL5/z4Bqt1pZbToqU/xjOxu+JjqQh415CMPK/mT2rh E8Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=mC4eKi+EXWoZRPrfUV1N8glp79RifPQr7qoE1+SIxKc=; b=qF1UjExWoCphtEEiqvY4aRIh6nLxtqC+J0032nKEgkaFsK3HjwTmr83/LsgtLWbdrP CaFHAQ60G+LestQzFbg2j0MtwsFdl0V+XP323g2SUfqOTDoDxEEi7zAoGrtp0WlndgzA vmJYC3OsyZHKa7jKrQfARG8KoFO+Lgz063OAaaZJCymyaxj68XtZlqmmTfNJGLgC5UPE muETyBHeVVwMBbGeYQgvvF8Bg60SNsXhl4S5Ohkc08yL3OwqmUMXgDMxK+pl5J8qFUSB 0i1gRA1G0QO3aCIhHh5VqRswpvx+Hc0NiqD3+ww3qFTSSXds3spAaOVPF/srT+5VmOCL OLBQ== X-Gm-Message-State: AElRT7F0AvDuA+bqMDTOaUSfDe2+eLHrwGvHl84e36uVqxXbeEVQC9GN BeGpuhc770Vgdi1RX4GRZVI= X-Received: by 10.28.71.138 with SMTP id m10mr178922wmi.93.1520543997242; Thu, 08 Mar 2018 13:19:57 -0800 (PST) Received: from andrea ([94.230.152.15]) by smtp.gmail.com with ESMTPSA id u20sm20785643wru.94.2018.03.08.13.19.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 13:19:56 -0800 (PST) Date: Thu, 8 Mar 2018 22:19:50 +0100 From: Andrea Parri To: "Paul E. McKenney" Cc: Ingo Molnar , "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 Message-ID: <20180308211950.GA3202@andrea> 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> <20180307155444.GA10367@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180307155444.GA10367@linux.vnet.ibm.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 07, 2018 at 07:54:44AM -0800, Paul E. McKenney wrote: > 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? Experienced should get there in a week (gcc help); newbies would (have to) rely on either on _properly updated_ documentation or weeks/months of code paging; scripts do the renaming. What am I missing? Andrea > > Thanx, Paul >