[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Refactor sync_lazy_execstate_cpu() into the more sensible
# HG changeset patch # User kaf24@xxxxxxxxxxxxxxxxxxxx # Node ID 3bbc9384be3f408a96baf6db4666bc21cebfb955 # Parent 37e9c9cd6c14a26fa396a0439f91e16a820d4e34 Refactor sync_lazy_execstate_cpu() into the more sensible sync_vcpu_execstate(). Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> diff -r 37e9c9cd6c14 -r 3bbc9384be3f xen/arch/ia64/xenmisc.c --- a/xen/arch/ia64/xenmisc.c Fri Aug 26 17:42:34 2005 +++ b/xen/arch/ia64/xenmisc.c Fri Aug 26 17:57:09 2005 @@ -58,7 +58,7 @@ /* calls in xen/common code that are unused on ia64 */ -void sync_lazy_execstate_cpu(unsigned int cpu) {} +void sync_vcpu_execstate(struct vcpu *v) {} #ifdef CONFIG_VTI int grant_table_create(struct domain *d) { return 0; } diff -r 37e9c9cd6c14 -r 3bbc9384be3f xen/arch/x86/domain.c --- a/xen/arch/x86/domain.c Fri Aug 26 17:42:34 2005 +++ b/xen/arch/x86/domain.c Fri Aug 26 17:57:09 2005 @@ -885,8 +885,13 @@ return switch_required; } -void sync_lazy_execstate_cpu(unsigned int cpu) -{ +void sync_vcpu_execstate(struct vcpu *v) +{ + unsigned int cpu = v->processor; + + if ( !cpu_isset(cpu, v->domain->cpumask) ) + return; + if ( cpu == smp_processor_id() ) { (void)__sync_lazy_execstate(); diff -r 37e9c9cd6c14 -r 3bbc9384be3f xen/common/schedule.c --- a/xen/common/schedule.c Fri Aug 26 17:42:34 2005 +++ b/xen/common/schedule.c Fri Aug 26 17:57:09 2005 @@ -218,9 +218,7 @@ && spin_is_locked(&schedule_data[v->processor].schedule_lock) ) cpu_relax(); - /* Counteract lazy context switching. */ - if ( cpu_isset(v->processor, v->domain->cpumask) ) - sync_lazy_execstate_cpu(v->processor); + sync_vcpu_execstate(v); } void vcpu_wake(struct vcpu *v) diff -r 37e9c9cd6c14 -r 3bbc9384be3f xen/include/xen/sched.h --- a/xen/include/xen/sched.h Fri Aug 26 17:42:34 2005 +++ b/xen/include/xen/sched.h Fri Aug 26 17:57:09 2005 @@ -250,10 +250,11 @@ void vcpu_sleep_sync(struct vcpu *d); /* - * Force loading of currently-executing domain state on the specified CPU. - * This is used to counteract lazy state switching where required. - */ -extern void sync_lazy_execstate_cpu(unsigned int cpu); + * Force synchronisation of given VCPU's state. If it is currently descheduled, + * this call will ensure that all its state is committed to memory and that + * no CPU is using critical state (e.g., page tables) belonging to the VCPU. + */ +extern void sync_vcpu_execstate(struct vcpu *v); /* * Called by the scheduler to switch to another VCPU. On entry, although @@ -265,7 +266,7 @@ * The callee must ensure that the local CPU is no longer running in @prev's * context, and that the context is saved to memory, before returning. * Alternatively, if implementing lazy context switching, it suffices to ensure - * that invoking sync_lazy_execstate() will switch and commit @prev's state. + * that invoking sync_vcpu_execstate() will switch and commit @prev's state. */ extern void context_switch( struct vcpu *prev, _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |