Re: [PATCH] sched/fair: favor non-idle group in tick preemption

From: Abel Wu
Date: Tue Nov 01 2022 - 05:14:35 EST


Hi Josh,

On 11/1/22 6:44 AM, Josh Don wrote:
...nit...
Some weirdness about this change though, is that if there is a
non-idle current entity, and the two next entities on the cfs_rq are
idle and non-idle respectively, we'll now take longer to preempt the
on-cpu non-idle entity, because the non-idle entity on the cfs_rq is
'hidden' by the idle 'first' entity. Wakeup preemption is different
because we're always directly comparing the current entity with the
newly woken entity.

Indeed. The hidden non-idle entity might run longer at the cost of
delayed preemption. This behavior is not compliant to the SCHED_NORMAL
semantics. But we also can't tell from here that the non-idle entity
contains SCHED_NORMAL tasks or not. As long as the entities do not
aware of the schedule policies, this ambiguity exists.

Best,
Abel