Re: [PATCH 1/1] kernel/sched:use the enum code replace of the int variable

From: peterz
Date: Fri Sep 11 2020 - 05:06:44 EST


On Mon, Sep 07, 2020 at 09:05:02PM +0800, qianjun.kernel@xxxxxxxxx wrote:
> From: jun qian <qianjun.kernel@xxxxxxxxx>
>
> It is hard to understand what the meaning of the value from
> the return value of wakeup_preempt_entity, so I fix it.

> @@ -6822,9 +6828,9 @@ static unsigned long wakeup_gran(struct sched_entity *se)
> * g
> * |<--->|c
> *
> - * w(c, s1) = -1
> - * w(c, s2) = 0
> - * w(c, s3) = 1
> + * w(c, s1) = NO_NEED_PREEMPT
> + * w(c, s2) = MAY_NEED_PREEMPT
> + * w(c, s3) = NEED_PREEMPT
> *
> */

Yeah, I don't think so. The function is a simple C style compare,
where negative is less, 0 is equal and positive is more than.