[RFC,6/9] sched:rtds: get guest time from time accounting code
diff mbox series

Message ID 1568197942-15374-7-git-send-email-andrii.anisov@gmail.com
State New
Headers show
Series
  • Changes to time accounting
Related show

Commit Message

Andrii Anisov Sept. 11, 2019, 10:32 a.m. UTC
From: Andrii Anisov <andrii_anisov@epam.com>

While the RTDS scheduler code does not use guest time from the
other pcpu, we are free to go with lockless time accounting.

Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>
---
 xen/common/sched_rt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index e0e350b..2ce200b 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -945,8 +945,9 @@  burn_budget(const struct scheduler *ops, struct rt_vcpu *svc, s_time_t now)
     if ( is_idle_vcpu(svc->vcpu) )
         return;
 
+    ASSERT(svc->vcpu == current);
     /* burn at nanoseconds level */
-    delta = now - svc->last_start;
+    delta = tacc_get_guest_time_delta();
     /*
      * delta < 0 only happens in nested virtualization;
      * TODO: how should we handle delta < 0 in a better way?
@@ -960,7 +961,6 @@  burn_budget(const struct scheduler *ops, struct rt_vcpu *svc, s_time_t now)
     }
 
     svc->cur_budget -= delta;
-    svc->last_start = now;
 
     if ( svc->cur_budget <= 0 )
     {