Fix a typo caused by 18898.
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 11 Dec 2008 11:30:13 +0000 (11:30 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 11 Dec 2008 11:30:13 +0000 (11:30 +0000)
new state is updated too early.

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
xen/common/schedule.c

index 872bcf397f3d45fb1a43cc6bc3f4a97a1fb3d18f..ccb7f1bd78f2f3524e76fd467d7aae6f9e9e7636 100644 (file)
@@ -91,14 +91,14 @@ static inline void vcpu_runstate_change(
 
     trace_runstate_change(v, new_state);
 
-    v->runstate.state = new_state;
-
     delta = new_entry_time - v->runstate.state_entry_time;
     if ( delta > 0 )
     {
         v->runstate.time[v->runstate.state] += delta;
         v->runstate.state_entry_time = new_entry_time;
     }
+
+    v->runstate.state = new_state;
 }
 
 void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate)