From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751369AbdAWVd6 (ORCPT ); Mon, 23 Jan 2017 16:33:58 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35870 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750945AbdAWVd5 (ORCPT ); Mon, 23 Jan 2017 16:33:57 -0500 Date: Mon, 23 Jan 2017 13:33:59 -0800 From: Lance Roy 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, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, dvhart@linux.intel.com, fweisbec@gmail.com, oleg@redhat.com, bobby.prani@gmail.com Subject: Re: [PATCH] SRCU: More efficient reader counts. Message-ID: <20170123133359.2d69756a@gmail.com> In-Reply-To: <20170123203508.GQ28085@linux.vnet.ibm.com> References: <1484520155-21017-1-git-send-email-paulmck@linux.vnet.ibm.com> <20170123201725.27392-1-ldr709@gmail.com> <20170123201725.27392-2-ldr709@gmail.com> <20170123203508.GQ28085@linux.vnet.ibm.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 23 Jan 2017 12:35:08 -0800 "Paul E. McKenney" wrote: > On Mon, Jan 23, 2017 at 12:17:25PM -0800, Lance Roy 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(). > > > > Possible bug: There is no guarantee that the lock counter won't overflow > > during srcu_readers_active_idx_check(), as there are no memory barriers > > around srcu_flip() (see comment in srcu_readers_active_idx_check() for > > details). However, this problem was already present before this patch. > > > > Suggested-by: Mathieu Desnoyers > > Signed-off-by: Lance Roy > > In general, the comment update looks good, but this patch undoes my > application of review feedback to your original patch. Could you please > submit the comment update as a separate patch on top of branch rcu/next > of my -rcu tree? > > git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git I have added the review feedback to the new patch. I will send the new version. If you prefer that the comment changes are in a separate patch I can change it, but I thought it would be better not to have an incorrect statement in the commit message. > Of course, if any of the changes from the review feedback are in any > way problematic, please do let me know. I don't see any problems. Thanks, Lance