Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965801AbcKOHvU (ORCPT ); Tue, 15 Nov 2016 02:51:20 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:43037 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965009AbcKOHvT (ORCPT ); Tue, 15 Nov 2016 02:51:19 -0500 Date: Tue, 15 Nov 2016 08:51:13 +0100 From: Peter Zijlstra To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, dvhart@linux.intel.com, fweisbec@gmail.com, oleg@redhat.com, bobby.prani@gmail.com, ldr709@gmail.com Subject: Re: [PATCH RFC tip/core/rcu] SRCU rewrite Message-ID: <20161115075113.GN3142@twins.programming.kicks-ass.net> References: <20161114183636.GA28589@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161114183636.GA28589@linux.vnet.ibm.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 743 Lines: 13 On Mon, Nov 14, 2016 at 10:36:36AM -0800, Paul E. McKenney wrote: > SRCU uses two per-cpu counters: a nesting counter to count the number of > active critical sections, and a sequence counter to ensure that the nesting > counters don't change while they are being added together in > srcu_readers_active_idx_check(). > > This patch instead uses per-cpu lock and unlock counters. Because the both > counters only increase and srcu_readers_active_idx_check() reads the unlock > counter before the lock counter, this achieves the same end without having > to increment two different counters in srcu_read_lock(). This also saves a > smp_mb() in srcu_readers_active_idx_check(). A very small improvement... I feel SRCU has much bigger issues :/