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

Re: [Xen-devel] [PATCH 1/2] xen: credit2: avoid vCPUs to ever reach lower credits than idle



On 12.03.20 16:26, Jan Beulich wrote:
On 12.03.2020 14:44, Dario Faggioli wrote:
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -234,7 +234,7 @@
   * units does not consume credits, and it must be lower than whatever
   * amount of credit 'regular' unit would end up with.
   */
-#define CSCHED2_IDLE_CREDIT          (-(1U<<30))
+#define CSCHED2_IDLE_CREDIT          INT_MIN

The title saying "lower than", is "equal" actually fine? Looking
at e.g. runq_insert() I'm getting the impression it's not.

Looking at t2c_update() I'm also getting the impression that
there's UB when the subtraction underflows. After all, if
-1 << 30 wasn't small enough a value, I don't see why -1 << 31
would be.

Yes, I'd limit svc->credit in t2c_update() to CSCHED2_IDLE_CREDIT+1


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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