From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Hecht Subject: Re: [PATCH 1/2] cpu steal time accounting Date: Thu, 23 Feb 2006 10:17:11 -0800 Message-ID: <43FDFC27.5030205@vmware.com> References: <43FCCB2C.5000408@vmware.com> <43FCFA9F.8080407@vmware.com> <259022e94a98f0f5df18a1fe678ccb89@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <259022e94a98f0f5df18a1fe678ccb89@cl.cam.ac.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Keir Fraser wrote: > > On 22 Feb 2006, at 23:58, Dan Hecht wrote: > >> To solve this, it may be best to have the hypervisor interface expose >> per-vcpu stolen time directly, rather than vcpu_time. Then the guest >> does not need to try to guess whether to charge (system_time - >> vcpu_time) against idle or steal. > > Yes, the distinction between stolen and available time does makes sense > (although I'm not sure 'available' is a great name) The term "available" came from looking at it from the perspective of the vcpu, rather than the hypervisor. To the vcpu, the time that it's running or halted is, in a sense, "available" to it (even though, (as an optimization) the hypervisor might use the pcpu to do something else when the vcpu is halted). But, anytime the hypervisor forces the vcpu to wait involuntarily, the time is no longer "available" to it, but stolen. Said another way, on native hardware, stolen time is zero. All time is "available" to the OS. Though it might choose to halt for some of this time, the time is still "available". > otherwise you can't > account for wakeup latencies. account_steal_time() would need to be > modified in Linux, though, as we would not need its dodgy heuristic for > deciding whether to account to stolen time or iowait/idle. > Exactly. We slightly refactor the account_steal_time() interface to have an interface that bypasses the heuristic. Dan