From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755352AbcKQShW (ORCPT ); Thu, 17 Nov 2016 13:37:22 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:33866 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755009AbcKQShT (ORCPT ); Thu, 17 Nov 2016 13:37:19 -0500 Date: Thu, 17 Nov 2016 22:45:44 +0800 From: Boqun Feng To: "Paul E. McKenney" Cc: Lai Jiangshan , LKML , Ingo Molnar , dipankar@in.ibm.com, akpm@linux-foundation.org, Mathieu Desnoyers , Josh Triplett , Thomas Gleixner , Peter Zijlstra , Steven Rostedt , David Howells , edumazet@google.com, dvhart@linux.intel.com, =?iso-8859-1?Q?Fr=E9d=E9ric?= Weisbecker , oleg@redhat.com, bobby.prani@gmail.com, ldr709@gmail.com Subject: Re: [PATCH RFC tip/core/rcu] SRCU rewrite Message-ID: <20161117144544.GC5227@tardis.cn.ibm.com> References: <20161114183636.GA28589@linux.vnet.ibm.com> <20161115014445.GC12110@tardis.cn.ibm.com> <20161115143700.GZ4127@linux.vnet.ibm.com> <20161117134957.GW3612@linux.vnet.ibm.com> <20161117143829.GA21600@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UfEAyuTBtIjiZzX6" Content-Disposition: inline In-Reply-To: <20161117143829.GA21600@linux.vnet.ibm.com> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --UfEAyuTBtIjiZzX6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 17, 2016 at 06:38:29AM -0800, Paul E. McKenney wrote: > On Thu, Nov 17, 2016 at 05:49:57AM -0800, Paul E. McKenney wrote: > > On Thu, Nov 17, 2016 at 08:18:51PM +0800, Lai Jiangshan wrote: > > > On Tue, Nov 15, 2016 at 10:37 PM, Paul E. McKenney > > > wrote: > > > > On Tue, Nov 15, 2016 at 09:44:45AM +0800, Boqun Feng wrote: > > >=20 > > > >> > > > >> __srcu_read_lock() used to be called with preemption disabled. I g= uess > > > >> the reason was because we have two percpu variables to increase. S= o with > > > >> only one percpu right, could we remove the preempt_{dis,en}able() = in > > > >> srcu_read_lock() and use this_cpu_inc() here? > > > > > > > > Quite possibly... > > > > > > >=20 > > > it will be nicer if it is removed. > > >=20 > > > The reason for the preemption-disabled was also because we > > > have to disallow any preemption between the fetching of the idx > > > and the increasement. so that we have at most NR_CPUS worth > > > of readers using the old index that haven't incremented the counters. > > >=20 > > > if we remove the preempt_{dis,en}able(). we must change the > > > "NR_CPUS" in the comment into ULONG_MAX/4. (I assume > > > one on-going reader needs at least need 4bytes at the stack). it is s= till safe. > > >=20 > > > but we still need to think more if we want to remove the preempt_{dis= ,en}able(). > >=20 > > Good points! Agreed, any change in the preemption needs careful thought > > and needs to be a separate patch. >=20 > And one area needing special thought is the call to __srcu_read_lock() > and __srcu_read_unlock() in do_exit(). >=20 So before commit 49f5903b473c5, we don't have the read of ->completed in preemption disable section? And following "git blame", I found commit 7a6b55e7108b3 ;-) Regards, Boqun > Thanx, Paul >=20 --UfEAyuTBtIjiZzX6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAABCAAGBQJYLcKUAAoJEEl56MO1B/q4X5AH/isYQ1+mVN9tnpNt8/Q3G0Cb +q+z3LTg039zHGzpnk5BvpvvK5mtxdjjKhfahQNYcp6rokwXidJid4MjXiGd31pI on84sScChGCAQuC+BncapvnQoeI3vVz4IqyOxoWgLJ3rGUgjzDhGs3dwSETMJxOv o3iO6W6yj5cBP7QU6IE38M74G5zYUmLvpPJifZm+CKNpgmKJqafXAM5ZH/EbZKtd JcCXw4zM2yZKzMcJdccZAJzHaEZw7UeTbAFs24j9unUhNO2CCSl0RVlZlUJl5n+Z 9BMePxwuxVgIKEWGZuONiXaOqg4ZrqKzDdRN/C0ih6khcp+7Pxn9E/AuC1tFvuY= =mP16 -----END PGP SIGNATURE----- --UfEAyuTBtIjiZzX6--