Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756318AbdDMJVD (ORCPT ); Thu, 13 Apr 2017 05:21:03 -0400 Received: from merlin.infradead.org ([205.233.59.134]:49190 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756013AbdDMJU7 (ORCPT ); Thu, 13 Apr 2017 05:20:59 -0400 Date: Thu, 13 Apr 2017 11:20:44 +0200 From: Peter Zijlstra 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, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, bobby.prani@gmail.com Subject: Re: [PATCH tip/core/rcu 01/40] rcu: Maintain special bits at bottom of ->dynticks counter Message-ID: <20170413092044.ur7nzbzst3jdlepx@hirez.programming.kicks-ass.net> References: <20170412174003.GA23207@linux.vnet.ibm.com> <1492018825-25634-1-git-send-email-paulmck@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1492018825-25634-1-git-send-email-paulmck@linux.vnet.ibm.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1634 Lines: 28 On Wed, Apr 12, 2017 at 10:39:46AM -0700, Paul E. McKenney wrote: > Currently, IPIs are used to force other CPUs to invalidate their TLBs > in response to a kernel virtual-memory mapping change. This works, but > degrades both battery lifetime (for idle CPUs) and real-time response > (for nohz_full CPUs), and in addition results in unnecessary IPIs due to > the fact that CPUs executing in usermode are unaffected by stale kernel > mappings. It would be better to cause a CPU executing in usermode to > wait until it is entering kernel mode to do the flush, first to avoid > interrupting usemode tasks and second to handle multiple flush requests > with a single flush in the case of a long-running user task. > > This commit therefore reserves a bit at the bottom of the ->dynticks > counter, which is checked upon exit from extended quiescent states. > If it is set, it is cleared and then a new rcu_eqs_special_exit() macro is > invoked, which, if not supplied, is an empty single-pass do-while loop. > If this bottom bit is set on -entry- to an extended quiescent state, > then a WARN_ON_ONCE() triggers. > > This bottom bit may be set using a new rcu_eqs_special_set() function, > which returns true if the bit was set, or false if the CPU turned > out to not be in an extended quiescent state. Please note that this > function refuses to set the bit for a non-nohz_full CPU when that CPU > is executing in usermode because usermode execution is tracked by RCU > as a dyntick-idle extended quiescent state only for nohz_full CPUs. > > Reported-by: Andy Lutomirski Isn't that more a: Requested-by ?