From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753239AbbFXOvn (ORCPT ); Wed, 24 Jun 2015 10:51:43 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:38075 "EHLO e36.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752837AbbFXOve (ORCPT ); Wed, 24 Jun 2015 10:51:34 -0400 X-Helo: d03dlp02.boulder.ibm.com X-MailFrom: paulmck@linux.vnet.ibm.com X-RcptTo: linux-kernel@vger.kernel.org Date: Wed, 24 Jun 2015 07:50:42 -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: <20150624145030.GB3717@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20150622122256.765619039@infradead.org> <20150622222152.GA4460@redhat.com> <20150623100932.GB3644@twins.programming.kicks-ass.net> <20150623105548.GE18673@twins.programming.kicks-ass.net> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150624073503.GH3644@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: 15062414-0021-0000-0000-00000BF6A3B0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 24, 2015 at 09:35:03AM +0200, Peter Zijlstra wrote: > On Tue, Jun 23, 2015 at 11:26:26AM -0700, Paul E. McKenney wrote: > > > I really think you're making that expedited nonsense far too accessible. > > > > This has nothing to do with accessibility and everything to do with > > robustness. And with me not becoming the triage center for too many > > non-RCU bugs. > > But by making it so you're rewarding abuse instead of flagging it :-( As discussed in the thread with Ingo, I will do both. Alternatively, RCU -is- abuse. Anyone who tries to tell you otherwise simply lacks proper respect for and adoration of traditional synchronization mechanisms. ;-) > > > > And we still need to be able to drop back to synchronize_sched() > > > > (AKA wait_rcu_gp(call_rcu_sched) in this case) in case we have both a > > > > creative user and a long-running RCU-sched read-side critical section. > > > > > > No, a long-running RCU-sched read-side is a bug and we should fix that, > > > its called a preemption-latency, we don't like those. > > > > Yes, we should fix them. No, they absolutely must not result in a > > meltdown of some unrelated portion of the kernel (like RCU), particularly > > if this situation occurs on some system running a production workload > > that doesn't happen to care about preemption latency. > > I still don't see a problem here though; the stop_one_cpu() invocation > for the CPU that's suffering its preemption latency will take longer, > but so what? > > How does polling and dropping back to sync_rcu() generate better > behaviour than simply waiting for the completion? Because if there is too much delay, synchronize_rcu() is no slower than is synchronize_rcu_expedited(), plus synchronize_rcu() is much more efficient. That said, it appears that I have not given any particular thought to the polling code since about 2008 or so, and it could use quite an upgrade... > > > > > + stop_one_cpu(cpu, synchronize_sched_expedited_cpu_stop, NULL); > > > > > > > > My thought was to use smp_call_function_single(), and to have the function > > > > called recheck dyntick-idle state, avoiding doing a set_tsk_need_resched() > > > > if so. > > > > > > set_tsk_need_resched() is buggy and should not be used. > > > > OK, what API is used for this purpose? > > As per exception you (rcu) already have access to resched_cpu(), use > that -- if it doesn't do what you need it to, we'll fix it, you're the > only consumer of it. Color me slow and stupid! And it looks like resched_cpu() does just fine on the local CPU, so it should be just fine as is. Thank you for the reminder. Thanx, Paul