From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751976AbcGNTiF (ORCPT ); Thu, 14 Jul 2016 15:38:05 -0400 Received: from merlin.infradead.org ([205.233.59.134]:46540 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751284AbcGNTiD (ORCPT ); Thu, 14 Jul 2016 15:38:03 -0400 Date: Thu, 14 Jul 2016 21:38:00 +0200 From: Peter Zijlstra To: "Paul E. McKenney" Cc: Oleg Nesterov , mingo@kernel.org, linux-kernel@vger.kernel.org, tj@kernel.org, john.stultz@linaro.org, dimitrysh@google.com, romlem@google.com, ccross@google.com, tkjos@google.com Subject: Re: [PATCH 2/2] locking/percpu-rwsem: Introduce bias knob Message-ID: <20160714193800.GN30154@twins.programming.kicks-ass.net> References: <20160714182545.786693675@infradead.org> <20160714183022.336211504@infradead.org> <20160714184351.GA18388@redhat.com> <20160714192018.GM30154@twins.programming.kicks-ass.net> <20160714192959.GY7094@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160714192959.GY7094@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 On Thu, Jul 14, 2016 at 12:29:59PM -0700, Paul E. McKenney wrote: > On Thu, Jul 14, 2016 at 09:20:18PM +0200, Peter Zijlstra wrote: > > /** > > + * rcu_sync_sabotage() - Sabotage a fresh rcu_sync instance > > + * @rsp: Pointer to rcu_sync structure to be sabotaged > > + * > > + * Must be called after rcu_sync_init() and before first use. > > + * > > + * Ensures rcu_sync_is_idle() returns false and rcu_sync_{enter,exit}() pairs > > + * turn into NO-OPs. > > + */ > > +void rcu_sync_sabotage(struct rcu_sync *rsp) > > +{ > > + rsp->gp_count++; > > + rsp->gp_state = !GP_IDLE; > > ??? A very strange way to say GP_PENDING. A new GP_DISABLED, perhaps? Right, so the important thing is that its not GP_IDLE, the rest doesn't really matter. This forces rcu_sync_is_idle() to return false. The skewed gp_count ensures rcu_sync_{enter,exit}() pairs no-op.