From: Keir Fraser Subject: Re: CPU Usage Discrepancies Date: Wed, 07 Mar 2007 08:32:49 +0000 Message-ID: References: <9fda5f510703061711w2b8d0adfx374096393a61a57d@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <9fda5f510703061711w2b8d0adfx374096393a61a57d@mail.gmail.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: Pradeep Vincent Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 7/3/07 01:11, "Pradeep Vincent" wrote: > Linux counts all the nanosecs not accounted by the hypervisor towards > "stolen" or "blocked" as its own usage. This should include all the > time spent in the hypervisor in the context of a particular Vcpu - The > hypervisor counts nsecs as "stolen" or "blocked" only after the Vcpu's > state is changed (from running to something else) So most part of the > hypervisor's CPU usage should be accounted for the same way by xm and > by /proc/stat on guests as they both use the same "stolen" and > "blocked" nsecs as accounted for and maintained by the hypervisor. > > Like you said context switch overhead isn't accounted for accurately > but hypervisor's cpu usage accounting suffers from the same problem > and to the same extent. Even if this isn't the case, context switch > cpu usage can't account for this big a difference. It sounds like you could track this one down yourself and post a patch if you find a bug? :-) -- Keir