From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Paul E. McKenney" Subject: Re: [PATCH 3/7] idle, thermal, acpi: Remove home grown idle implementations Date: Thu, 21 Nov 2013 12:07:17 -0800 Message-ID: <20131121200717.GB4138@linux.vnet.ibm.com> References: <20131120160450.072555619@infradead.org> <20131120162736.508462614@infradead.org> <20131120165406.14fa0f09@ultegra> <20131121082151.GU10022@twins.programming.kicks-ass.net> <20131121160716.GT4138@linux.vnet.ibm.com> <528E32EF.2050300@linux.intel.com> <20131121191916.GZ4138@linux.vnet.ibm.com> <528E62D0.3010003@linux.intel.com> Reply-To: paulmck@linux.vnet.ibm.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from e35.co.us.ibm.com ([32.97.110.153]:45026 "EHLO e35.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751923Ab3KUUHX (ORCPT ); Thu, 21 Nov 2013 15:07:23 -0500 Received: from /spool/local by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 21 Nov 2013 13:07:23 -0700 Content-Disposition: inline In-Reply-To: <528E62D0.3010003@linux.intel.com> Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Arjan van de Ven Cc: Peter Zijlstra , Jacob Pan , lenb@kernel.org, rjw@rjwysocki.net, Eliezer Tamir , Chris Leech , David Miller , rui.zhang@intel.com, Mike Galbraith , Ingo Molnar , hpa@zytor.com, Thomas Gleixner , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, "Rafael J. Wysocki" On Thu, Nov 21, 2013 at 11:45:20AM -0800, Arjan van de Ven wrote: > On 11/21/2013 11:19 AM, Paul E. McKenney wrote: > >On Thu, Nov 21, 2013 at 08:21:03AM -0800, Arjan van de Ven wrote: > >>On 11/21/2013 8:07 AM, Paul E. McKenney wrote: > >>>As long as RCU has some reliable way to identify an idle task, I am > >>>good. But I have to ask -- why can't idle injection coordinate with > >>>the existing idle tasks rather than temporarily making alternative > >>>idle tasks? > >> > >>it's not a real idle. that's the whole problem of the situation. > >>to the rest of the OS, this is being BUSY (busy saving power using > >>a CPU instruction, but it might as well have been an mdelay() operation) > >>and it's also what end users expect; they want to be able to see > >>where there performance (read: cpu time in "top") is going. > > > >My concern is keeping RCU's books straight. Suppose that there is a need > >to call for idle in the middle of a preemptible RCU read-side critical > >section. Now, if that call for idle involves a context switch, all is > >well -- RCU will see the task as still being in its RCU read-side critical > >section, which means that it is OK for RCU to see the CPU as idle. > > > >However, if there is no context switch and RCU sees the CPU as idle, > >preemptible RCU could prematurely end the grace period. If there is no > >context switch and RCU sees the CPU as non-idle for too long, we start > >getting RCU CPU stall warning splats. > > > >Another approach would be to only inject idle when the CPU is not > >doing anything that could possibly be in an RCU read-side critical > >section. But things might get a bit hot in case of an overly > >long RCU read-side critical section. > > > >One approach that might work would be to hook into RCU's context-switch > >code going in and coming out, then telling RCU that the CPU is idle, > >even though top and friends see it as non-idle. This last is in fact > >similar to how RCU handles userspace execution for NO_HZ_FULL. > > > > so powerclamp and such are not "idle". > They are "busy" from everything except the lowest level of the CPU hardware. > once you start thinking of them as idle, all hell breaks lose in terms of implications > (including sysadmin visibility etc).... (hence some of the explosions in this thread > as well). > > but it's not "idle". > > it's "put the cpu in a low power state for a specified amount of time". sure it uses the same > instruction to do so that the idle loop uses. > > (now to make it messy, the current driver does a bunch of things similar to the idle loop > which is a mess and fair to be complained about) Then from an RCU viewpoint, they need to be short in duration. Otherwise you risk getting CPU stall-warning explosions from RCU. ;-) Thanx, Paul