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] [xen-unstable] xentrace: fix lost records resume

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xentrace: fix lost records resume
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 13 Apr 2010 14:55:40 -0700
Delivery-date: Tue, 13 Apr 2010 15:04:51 -0700
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1271093313 -3600
# Node ID 9471200daee46c5a6f3b054b0a53f95545386029
# Parent  94cae4dfa25bcf9aaeb93fb374926cb40411ebdf
xentrace: fix lost records resume

Reorder the SCHED_SWITCH trace before the runstate change trace to fix
a problem with the lost records "resume" code.

Namely: The "lost records" trace includes the currently running
process.  But during SCHED_SWITCH, it reads the wrong value, confusing
xenalyze.  Making sure there are no trace records between runstate
change trace and the actual context switch fixes it.

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
---
 xen/common/schedule.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff -r 94cae4dfa25b -r 9471200daee4 xen/common/schedule.c
--- a/xen/common/schedule.c     Mon Apr 12 17:54:48 2010 +0100
+++ b/xen/common/schedule.c     Mon Apr 12 18:28:33 2010 +0100
@@ -877,6 +877,11 @@ static void schedule(void)
              next_slice.time);
 
     ASSERT(prev->runstate.state == RUNSTATE_running);
+
+    TRACE_4D(TRC_SCHED_SWITCH,
+             prev->domain->domain_id, prev->vcpu_id,
+             next->domain->domain_id, next->vcpu_id);
+
     vcpu_runstate_change(
         prev,
         (test_bit(_VPF_blocked, &prev->pause_flags) ? RUNSTATE_blocked :
@@ -887,6 +892,11 @@ static void schedule(void)
     ASSERT(next->runstate.state != RUNSTATE_running);
     vcpu_runstate_change(next, RUNSTATE_running, now);
 
+    /*
+     * NB. Don't add any trace records from here until the actual context
+     * switch, else lost_records resume will not work properly.
+     */
+
     ASSERT(!next->is_running);
     next->is_running = 1;
 
@@ -899,10 +909,6 @@ static void schedule(void)
     /* Ensure that the domain has an up-to-date time base. */
     update_vcpu_system_time(next);
     vcpu_periodic_timer_work(next);
-
-    TRACE_4D(TRC_SCHED_SWITCH,
-             prev->domain->domain_id, prev->vcpu_id,
-             next->domain->domain_id, next->vcpu_id);
 
     context_switch(prev, next);
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xentrace: fix lost records resume, Xen patchbot-unstable <=