[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] x86, hvm: Clean up periodic timer code a little. This leads naturally
# HG changeset patch # User Keir Fraser <keir@xxxxxxxxxxxxx> # Date 1194517998 0 # Node ID 8ff5bb70136dbb8ae4a725400334f4bff3643ba8 # Parent 6d7ea0cf6e5b16529bce7cb25ec9c7d22b86dc83 x86, hvm: Clean up periodic timer code a little. This leads naturally to a no-missed-tick-accounting mode which is a combination of ticks delivered 'off beat' immediately upon re-scheduling when ticks are missed, then reverting to delivering ticks 'on beat' as usual. Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> --- xen/arch/x86/hvm/vpt.c | 26 ++++++++++---------------- 1 files changed, 10 insertions(+), 16 deletions(-) diff -r 6d7ea0cf6e5b -r 8ff5bb70136d xen/arch/x86/hvm/vpt.c --- a/xen/arch/x86/hvm/vpt.c Thu Nov 08 10:23:22 2007 +0000 +++ b/xen/arch/x86/hvm/vpt.c Thu Nov 08 10:33:18 2007 +0000 @@ -56,17 +56,9 @@ static void pt_process_missed_ticks(stru if ( missed_ticks <= 0 ) return; - if ( mode_is(pt->vcpu->domain, no_missed_tick_accounting) ) - { - pt->pending_intr_nr = 1; - pt->scheduled = now + pt->period; - } - else - { - missed_ticks = missed_ticks / (s_time_t) pt->period + 1; - pt->pending_intr_nr += missed_ticks; - pt->scheduled += missed_ticks * pt->period; - } + missed_ticks = missed_ticks / (s_time_t) pt->period + 1; + pt->pending_intr_nr += missed_ticks; + pt->scheduled += missed_ticks * pt->period; } static void pt_freeze_time(struct vcpu *v) @@ -131,10 +123,7 @@ static void pt_timer_fn(void *data) pt_lock(pt); - if ( mode_is(pt->vcpu->domain, no_missed_tick_accounting) ) - pt->pending_intr_nr = 1; - else - pt->pending_intr_nr++; + pt->pending_intr_nr++; if ( !pt->one_shot ) { @@ -235,11 +224,16 @@ void pt_intr_post(struct vcpu *v, struct } else { - pt->pending_intr_nr--; if ( mode_is(v->domain, no_missed_tick_accounting) ) + { pt->last_plt_gtime = hvm_get_guest_time(v); + pt->pending_intr_nr = 0; /* 'collapse' all missed ticks */ + } else + { pt->last_plt_gtime += pt->period_cycles; + pt->pending_intr_nr--; + } } if ( mode_is(v->domain, delay_for_missed_ticks) && _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |