From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber Costa Subject: [RFC 0/7] KVM steal time implementation Date: Wed, 25 Aug 2010 17:43:10 -0400 Message-ID: <1282772597-4183-1-git-send-email-glommer@redhat.com> Cc: avi@redhat.com, zamsden@redhat.com, mtosatti@redhat.com, riel@redhat.com To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:6675 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752480Ab0HYV7P (ORCPT ); Wed, 25 Aug 2010 17:59:15 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7PLxF5C009148 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 25 Aug 2010 17:59:15 -0400 Sender: kvm-owner@vger.kernel.org List-ID: Hi, In this series, I am proposing an steal time implementation for KVM. It is an RFC, so don't be too harsh =] There are two parts of it: the guest and host part. The proposal for the guest part, is to just change the common time accounting, and try to identify at that spot, wether or not we should account any steal time. I considered this idea less cumbersome that trying to cook a clockevents implementation ourselves, since I see little value in it. I am, however, pretty open to suggestions. For the host<->guest communications, I am using a shared page, in the same way as pvclock. Because of that, I am just hijacking pvclock structure anyway. There is a 32-bit field floating by, that gives us enough room for 8 years of steal time (we use msec resolution). The main idea is to timestamp our exit and entry through sched notifiers, and export the value at pvclock updates. This obviously have some disadvantages: by doing this we are giving up futures ideas about only updating this structure once, and even right now, won't work on pinned-smp (since we don't update pvclock if we haven't changed cpus.) But again, it is just an RFC, and I'd like to feel the reception of the idea as a whole. Have a nice review. Glauber Costa (6): change headers preparing for steal time measure time out of guest change kernel accounting to include steal time kvm steal time implementation touch softlockup watchdog tell guest about steal time feature Zachary Amsden (1): Implement getnsboottime kernel API arch/x86/include/asm/kvm_host.h | 2 + arch/x86/include/asm/kvm_para.h | 1 + arch/x86/include/asm/pvclock-abi.h | 4 ++- arch/x86/kernel/kvmclock.c | 38 ++++++++++++++++++++++++++++++++++++ arch/x86/kvm/x86.c | 15 ++++++++++++- include/linux/sched.h | 1 + include/linux/time.h | 1 + kernel/sched.c | 29 +++++++++++++++++++++++++++ kernel/time/timekeeping.c | 27 +++++++++++++++++++++++++ 9 files changed, 115 insertions(+), 3 deletions(-)