[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] schedule: initialize 'now' when really needed



commit 00aee8b3fc21caea807d7e0a64d88b2b3437e3d3
Author:     Baodong Chen <chenbaodong@xxxxxxxxxx>
AuthorDate: Mon Jun 3 17:15:44 2019 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Jun 3 17:15:44 2019 +0200

    schedule: initialize 'now' when really needed
    
    when 'periodic_period' is zero, there is no need to initialize 'now'.
    
    Signed-off-by: Baodong Chen <chenbaodong@xxxxxxxxxx>
    Acked-by: Dario Faggioli <dfaggioli@xxxxxxxx>
---
 xen/common/schedule.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 66f1e2611b..86341bc8fb 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1385,12 +1385,13 @@ long sched_adjust_global(struct xen_sysctl_scheduler_op 
*op)
 
 static void vcpu_periodic_timer_work(struct vcpu *v)
 {
-    s_time_t now = NOW();
+    s_time_t now;
     s_time_t periodic_next_event;
 
     if ( v->periodic_period == 0 )
         return;
 
+    now = NOW();
     periodic_next_event = v->periodic_last_event + v->periodic_period;
 
     if ( now >= periodic_next_event )
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.