[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 Thu, 2020-03-12 at 16:26 +0100, 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.
In Credit2, we don't have the idle vCPUs in the runqueue. So we will
never compare non-idle with idle while inserting.

But this is a good point, in general, and I think we may need to turn
the ">"
in a ">=" in runq_candidate().

> 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.
Mmm... not sure I am getting. Are you suggesting we should apply a cap
to val?

If yes, this looks like an issue independent from what the value of
CSCHED2_IDLE_CREDIT is, but yeah, we can do that. Or am I missing

Dario Faggioli, Ph.D
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)

Attachment: signature.asc
Description: This is a digitally signed message part

Xen-devel mailing list



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