Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760044AbYCEQzc (ORCPT ); Wed, 5 Mar 2008 11:55:32 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754877AbYCEQzX (ORCPT ); Wed, 5 Mar 2008 11:55:23 -0500 Received: from gateway.drzeus.cx ([85.8.24.16]:51997 "EHLO smtp.drzeus.cx" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751541AbYCEQzW (ORCPT ); Wed, 5 Mar 2008 11:55:22 -0500 Date: Wed, 5 Mar 2008 17:53:39 +0100 From: Pierre Ossman To: Andi Kleen Cc: Andi Kleen , "Pallipadi, Venkatesh" , Dave Jones , Alan Stern , LKML , Adam Belay , Lee Revell , linux-pm@lists.linux-foundation.org, Pavel Machek Subject: Re: [linux-pm] [PATCH] cpuidle: avoid singing capacitors Message-ID: <20080305175339.2059226b@mjolnir.drzeus.cx> In-Reply-To: <20080305154856.GC553@one.firstfloor.org> References: <20080303231033.GB15255@one.firstfloor.org> <20080304040048.GA31562@codemonkey.org.uk> <20080304071423.0e6b71c1@mjolnir.drzeus.cx> <20080304181924.70aaf8c1@mjolnir.drzeus.cx> <20080304172918.GA27332@one.firstfloor.org> <20080304183032.17084e39@mjolnir.drzeus.cx> <20080304174315.GB27332@one.firstfloor.org> <20080304190446.775165e3@mjolnir.drzeus.cx> <20080304183406.GC27332@one.firstfloor.org> <20080305070454.3df78593@mjolnir.drzeus.cx> <20080305154856.GC553@one.firstfloor.org> X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1717 Lines: 43 On Wed, 5 Mar 2008 16:48:56 +0100 Andi Kleen wrote: > > Start: You discovered at some point where you currently have code a variable > is not updated yet. > Fact: You have some new code that runs before that point > Information: The variable is updated later eventually in the idle exit path. > Fact II: You require the variable to be updated in your new code For some value of "require". The code will do what it's supposed to do anyway, just in a sub-optimal way (it will avoid a deep sleep even though it didn't need to). > Possible solutions: > (1) you move your new code in a point of the idle exit path after the variable > is updated But I don't use jiffies in the idle exit path, only the entry path. > (2) you move the code that updates the variable earlier before your code Which basically leaves this option. I.e. guarantee that jiffies are updated between one cpuidle reflect and the subsequent select. > Solution: I described the first variant which is likely easier. > How: I told you where it is updated, so that shouldn't be too difficult. > Action: Implement solution (1) or (2) > Action: Test if it works > Check: If test succeeded exit > Otherwise: Restart at Start > Now you're just being a smart-ass. :) -- -- Pierre Ossman Linux kernel, MMC maintainer http://www.kernel.org PulseAudio, core developer http://pulseaudio.org rdesktop, core developer http://www.rdesktop.org -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/