WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Refactor sync_lazy_execstate_cpu() into the more sensibl

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Refactor sync_lazy_execstate_cpu() into the more sensible
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 26 Aug 2005 17:58:12 +0000
Delivery-date: Fri, 26 Aug 2005 17:56:38 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Refactor sync_lazy_execstate_cpu() into the more sensible, Xen patchbot -unstable <=