sched: removal of redundant check in Credit
authorPraveen Kumar <kpraveen.lkml@gmail.com>
Wed, 21 Dec 2016 15:53:35 +0000 (16:53 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 21 Dec 2016 15:53:35 +0000 (16:53 +0100)
The patch gets rid of a redundant check in csched_vcpu_acct. In fact,
the function is only called from csched_tick, which already checks
that current is not the idle vcpu. The patch also adds an ASSERT to
the same effect, in order to make assumption ( i.e., no calling this
on idle vcpus) even more clear and as a guard for future mis-use.

Signed-off-by: Praveen Kumar <kpraveen.lkml@gmail.com>
Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
xen/common/sched_credit.c

index fc3a32127c2312a60ca69db5f23c4be2e1feef3c..dfe85458007784a61ef6a15e96514533f03ce19f 100644 (file)
@@ -941,6 +941,7 @@ csched_vcpu_acct(struct csched_private *prv, unsigned int cpu)
 
     ASSERT( current->processor == cpu );
     ASSERT( svc->sdom != NULL );
+    ASSERT( !is_idle_vcpu(svc->vcpu) );
 
     /*
      * If this VCPU's priority was boosted when it last awoke, reset it.
@@ -957,8 +958,7 @@ csched_vcpu_acct(struct csched_private *prv, unsigned int cpu)
     /*
      * Update credits
      */
-    if ( !is_idle_vcpu(svc->vcpu) )
-        burn_credits(svc, NOW());
+    burn_credits(svc, NOW());
 
     /*
      * Put this VCPU and domain back on the active list if it was