Re: [PATCH v4 06/24] sched/fair: Collect load-balancing stats for IPC classes
From: Tim Chen
Date: Mon Jun 26 2023 - 15:53:06 EST
> >
> > nit: the comment is unnecessary, and a bit misleading, IMO.
> >
> > The comment says "This group will not be selected." but the only way to
> > guarantee that here is to reset the sum_score to 0 when you find an
> > invalid score, which I don't believe is your intention.
>
> You raise an interesting point. We will call this function for each rq
> in the sched group. Thus, if we encounter an error, the scores would be
> incomplete. Therefore, I think that the scores should be discarded and
> reset to 0 so that they are not used, IMO.
Since we still have other rqs to loop through, reset to 0 here does
not guarantee that it will stay that way at the end of the loop when
the sum could still be added to. May need a special value like -EINVAL
and make the score a "long" to mark such case.
Tim