schedule: initialize 'now' when really needed

when 'periodic_period' is zero, there is no need to initialize 'now'.

Signed-off-by: Baodong Chen <chenbaodong@mxnavi.com>
Acked-by: Dario Faggioli <dfaggioli@suse.com>
This commit is contained in:
Baodong Chen authored and Jan Beulich committed 2019-06-03 17:15:44 +02:00
1 parent 8a184632a1
commit 00aee8b3fc
1 file changed
+2 -1
+2 -1
View File
@@ -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 )
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.