From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rik van Riel Subject: Re: [PATCH] 1/2: cpufreq/PowerNow! in Xen: Time and platform changes Date: Thu, 30 Aug 2007 16:56:24 -0400 Message-ID: <46D72EF8.7020207@redhat.com> References: <46D70B20.2010108@redhat.com> <1449F58C868D8D4E9C72945771150BDF0207700B@SAUSEXMB1.amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1449F58C868D8D4E9C72945771150BDF0207700B@SAUSEXMB1.amd.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Langsdorf, Mark" Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org Langsdorf, Mark wrote: >> Here is the missing piece of the puzzle. A platform >> hypercall operation to get system wide idle time. >> >> I believe Mark's changes, together with this little >> patch, are the way we can get cpufreq working on >> Xen with the minimal amount of code duplication. >> >> Duplicating code anywhere, whether it be inside the >> hypervisor or in some Xen-only userland package, will >> only lead to bit rot and make Xen maintenance more >> painful. > > This code looks like it returns the amount of time > spent in the running runstate, not the idle time. > Am I completely missing something? It is the time that the CPU's _idle domain_ has spent in RUNSTATE_running. This corresponds to the idle time on each physical CPU. > For reference, the ondemand governor calculates > idle time as the sum of cpustat.idle and cpustat.iowait. > I'd think the equivalent would be the sum of > RUNSTATE_runnable and RUNSTATE_blocked. The hypervisor has no concept of iowait on a physical CPU basis. It only tracks domain VCPUs and the idle domain VCPUs. Since the idle domain VCPUs never migrate between CPUs, they reflect physical CPU idle time. -- Politics is the struggle between those who want to make their country the best in the world, and those who believe it already is. Each group calls the other unpatriotic.