aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hvm/vpt.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-02-13 09:43:06 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-02-13 09:43:06 +0000
commit0eecf73be6e7304f382dd16491cd2917f5135bae (patch)
tree7dbede426b91e2337b906fda58bebe380279d7a1 /xen/arch/x86/hvm/vpt.c
parent737073ac89f753d7601933a29bf71365f733744b (diff)
downloadxen-0eecf73be6e7304f382dd16491cd2917f5135bae.tar.gz
xen-0eecf73be6e7304f382dd16491cd2917f5135bae.tar.bz2
xen-0eecf73be6e7304f382dd16491cd2917f5135bae.zip
hvm: Align periodic vpts.
Aligned periodic vpts can improve the HVM guest power consumption a lot, especially while the guest using high HZ such as 1000HZ. Signed-off-by: Wei Gang <gang.wei@intel.com>
Diffstat (limited to 'xen/arch/x86/hvm/vpt.c')
-rw-r--r--xen/arch/x86/hvm/vpt.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index 5dae7cd505..33f2400a0e 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -389,8 +389,14 @@ void create_periodic_time(
* LAPIC ticks for process accounting can see long sequences of process
* ticks incorrectly accounted to interrupt processing.
*/
- if ( !pt->one_shot && (pt->source == PTSRC_lapic) )
- pt->scheduled += delta >> 1;
+ if ( !pt->one_shot )
+ {
+ if ( v->domain->arch.hvm_domain.params[HVM_PARAM_VPT_ALIGN] )
+ pt->scheduled = align_timer(pt->scheduled, pt->period);
+ else if ( pt->source == PTSRC_lapic )
+ pt->scheduled += delta >> 1;
+ }
+
pt->cb = cb;
pt->priv = data;