All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] xen: sched: removal of redundant check in Credit
@ 2016-12-16 19:23 Praveen Kumar
  2016-12-17  1:46 ` Dario Faggioli
  0 siblings, 1 reply; 7+ messages in thread
From: Praveen Kumar @ 2016-12-16 19:23 UTC (permalink / raw)
  To: xen-devel; +Cc: george.dunlap, dario.faggioli, Praveen Kumar

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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index fc3a321..dfe8545 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -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
--
1.8.5.6


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-12-28 14:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-16 19:23 [PATCH v3] xen: sched: removal of redundant check in Credit Praveen Kumar
2016-12-17  1:46 ` Dario Faggioli
2016-12-17  8:14   ` Praveen Kumar
2016-12-20  9:04     ` Praveen Kumar
2016-12-20 13:18       ` Dario Faggioli
2016-12-28  9:02   ` George Dunlap
2016-12-28 14:23     ` Dario Faggioli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.