Messages in this thread | | | Date | Wed, 1 Feb 2023 17:06:01 +0100 | From | Peter Zijlstra <> | Subject | Re: [PATCH v2] sched/fair: sanitize vruntime of entity being placed |
| |
On Mon, Jan 30, 2023 at 01:22:16PM +0100, Roman Kagan wrote: > From: Zhang Qiao <zhangqiao22@huawei.com> > > When a scheduling entity is placed onto cfs_rq, its vruntime is pulled > to the base level (around cfs_rq->min_vruntime), so that the entity > doesn't gain extra boost when placed backwards. > > However, if the entity being placed wasn't executed for a long time, its > vruntime may get too far behind (e.g. while cfs_rq was executing a > low-weight hog), which can inverse the vruntime comparison due to s64 > overflow. This results in the entity being placed with its original > vruntime way forwards, so that it will effectively never get to the cpu. > > To prevent that, ignore the vruntime of the entity being placed if it > didn't execute for much longer than the characteristic sheduler time > scale. > > Signed-off-by: Zhang Qiao <zhangqiao22@huawei.com> > [rkagan: formatted, adjusted commit log, comments, cutoff value] > Co-developed-by: Roman Kagan <rkagan@amazon.de> > Signed-off-by: Roman Kagan <rkagan@amazon.de>
Thanks!
| |