Re: [PATCH 4/4] sched/fair: Revert 6d71a9c61604 ("sched/fair: Fix EEVDF entity placement bug causing scheduling lag")
From: Zhang Qiao
Date: Mon Feb 02 2026 - 06:23:21 EST
在 2026/2/2 17:12, Peter Zijlstra 写道:
> On Sat, Jan 31, 2026 at 04:21:39PM +0100, Peter Zijlstra wrote:
>> On Sat, Jan 31, 2026 at 09:47:07AM +0800, Zhang Qiao wrote:
>>
>>>> if (se->on_rq) {
>>>> /* commit outstanding execution time */
>>>> update_curr(cfs_rq);
>>>> - update_entity_lag(cfs_rq, se);
>>>> - se->deadline -= se->vruntime;
>>>> + avruntime = avg_vruntime(cfs_rq);
>>>> + se->vlag = entity_lag(avruntime, se);
>>>
>>>
>>> vlag is updated here. Considering vlag and vprot share the same union, updating
>>> vlag will overwrite vprot. Is it right to call protect_slice() (which use vprot)
>>> after this update?
>>
>> Oh you are quite right; I'm sure Ingo had a patch removing that union,
>> but clearly that's not been merged yet.
>>
>> Sorry about that mistake; I'll make a new version on Monday.
>
> After looking at things, I think the best option is to simply remove
> that union.
>
Agreed. The union makes the code logic overly complex and error-prone.
> The thing is, I can fix reweight to respect this union, but there are
> more problems, notably the sched_change pattern will not only call
> put_prev_task/set_next_task, it will actually dequeue/enqueue the thing
> and therefore 'temporarily' use the vlag field, destroying the vprot
> value.
>
> And yes, we can fix all that, but I'm thinking that at that point the
> union is more trouble than its worth.
>
>
> .
>