From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753169AbbFXQJS (ORCPT ); Wed, 24 Jun 2015 12:09:18 -0400 Received: from e33.co.us.ibm.com ([32.97.110.151]:51062 "EHLO e33.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752260AbbFXQJI (ORCPT ); Wed, 24 Jun 2015 12:09:08 -0400 X-Helo: d03dlp01.boulder.ibm.com X-MailFrom: paulmck@linux.vnet.ibm.com X-RcptTo: linux-kernel@vger.kernel.org Date: Wed, 24 Jun 2015 09:09:04 -0700 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Oleg Nesterov , tj@kernel.org, mingo@redhat.com, linux-kernel@vger.kernel.org, der.herr@hofr.at, dave@stgolabs.net, riel@redhat.com, viro@ZenIV.linux.org.uk, torvalds@linux-foundation.org Subject: Re: [RFC][PATCH 12/13] stop_machine: Remove lglock Message-ID: <20150624160851.GF3717@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20150623112041.GF18673@twins.programming.kicks-ass.net> <20150623130826.GG18673@twins.programming.kicks-ass.net> <20150623173038.GJ3892@linux.vnet.ibm.com> <20150623180411.GF3644@twins.programming.kicks-ass.net> <20150623182626.GO3892@linux.vnet.ibm.com> <20150624073503.GH3644@twins.programming.kicks-ass.net> <20150624145030.GB3717@linux.vnet.ibm.com> <20150624150151.GN3644@twins.programming.kicks-ass.net> <20150624152705.GE3717@linux.vnet.ibm.com> <20150624154010.GS19282@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150624154010.GS19282@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15062416-0009-0000-0000-00000BF8F546 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 24, 2015 at 05:40:10PM +0200, Peter Zijlstra wrote: > On Wed, Jun 24, 2015 at 08:27:19AM -0700, Paul E. McKenney wrote: > > > The thing is, if we're stalled on a stop_one_cpu() call, the sync_rcu() > > > is equally stalled. The sync_rcu() cannot wait more efficient than we're > > > already waiting either. > > > > Ah, but synchronize_rcu() doesn't force waiting on more than one extra > > grace period. With strictly queued mutex, you can end up waiting on > > several. > > But you could fix that by replacing/augmenting the expedited ticket with > gpnum/copmleted as used in get_state_synchronize_rcu()/cond_synchronize_rcu(). Yes, good point, that would be a way of speeding the existing polling loop up in the case where the polling loop took longer than a normal grace period. Might also be a way to speed up the new "polling" regime, but I am still beating up the counters. ;-) But if the mutex serializes everything unconditionally, then you have already potentially waited for several grace periods worth of time before you get a chance to check the ticket, so the check doesn't help. Or am I missing something subtle here? It looks like I do need to use smp_call_function_single() and your resched_cpu() because calling stop_one_cpu() sequentially is about twice as slow as try_stop_cpus() in rcutorture runs of up to 16 CPUs. But either way, your point about not stopping all the CPUs does hold. Thanx, Paul