Re: [PATCH 13/20] sched/eevdf: Try to push short slice task on a better CPU

From: Li kunyu

Date: Fri Nov 13 2026 - 11:05:17 EST




On 2026/11/13 18:49, Vincent Guittot wrote:
> On Fri, 13 Nov 2026 at 10:25, Li kunyu <likunyu@xxxxxxxxxxxxxx> wrote:
>>
>>
>>
>> On 2026/11/6 23:19, Vincent Guittot wrote:
>>> static bool fair_check_pushable_task(struct rq *rq, struct task_struct *p, struct task_struct *next)
>>> {
>>> if (!__check_pushable_fair_task(rq, p))
>>> @@ -10120,6 +10137,12 @@ static bool fair_check_pushable_task(struct rq *rq, struct task_struct *p, struc
>>> if (next == p)
>>> return false;
>>>
>>> + if (next && next->sched_class != p->sched_class)
>>> + return true;
>>
>> Would it be more appropriate to use sched_class_above(next->sched_class,
>> &fair_sched_class) here? I think placing prev on rq->cfs.pushable_tasks is
>> justified only when next belongs to a scheduling class strictly higher than fair.
>
> class strictly higher is the most common case but we can have cases
> where sched ext dl server preempt fair task

Perhaps I was thinking of scenarios with moderate to high load, such as cloud
computing or server environments. In such cases, there may be few opportunities
for successful migration - for example, because it would only put additional
pressure on an already heavily loaded CPU - and even lock contention could
become a bottleneck. Of course, this is just speculation on my part.

>>
>> I also wonder whether doing this in the normal CFS hot paths -
>> put_prev_task_fair(), set_next_task_fair() is really desirable. PATCH 09/20
>> already replaces the unconditional raw_spin_rq_unlock() + task_rq_lock()
>> sequence with a raw_spin_trylock(&next_task->pi_lock) that skips the push when
>> the task is already locked, which I agree is an improvement.
>> But could the push decision itself be moved into the load balancing path
>> instead? That would keep the hot paths free of migration-related locking and
>
> LB is not the right place for several reasons:
> - the period between LB can be quite long compared to scheduling constraint
> - EAS disables load balance
> - periodic load balance looks at balancing the CPUs in a scheduling
> domain without taking care of indiviual tasks requirements. It looks
> at CPUs and then tries to find a task on this CPU that matches the
> constraints whereas the push mecansim is done per task so we can take
> into account task specific insights like slice, min capacity,
> preferred_llc when looking at a CPU.
> - We want to use push in a selected number of cases where we want to
> act immediately

I have an idea worth discussing. For example, the push could be added to
sched_balance_softirq or a similar new softirq/interrupt context. This would
avoid issues such as inconsistent load-balancing intervals and EAS being
disabled. For instance, the push could be triggered when the current CPU's load
exceeds a certain threshold or when the CPU is not running purely CFS tasks.

>> select_task_rq_fair() calls. Or is the next-aware context (knowing which task is
>> preempting) something the load balancer cannot reconstruct, making the current
>> placement necessary?
>>
>> Is my understanding correct?
>>
>> https://lore.kernel.org/all/20261020083746.37068-2-likunyu@xxxxxxxxxxxxxx/
>>
>> The SMT push work in this patch is intentionally quite simple; I think
>> it could be generalized with only modest changes to perform push at
>> larger scheduling-domain scopes, such as the LLC (last-level cache)
>> domain.
>>
>> I realize the push direction is somewhat at odds with the current
>> cache-aware scheduling work, which instead tries to make cross-LLC
>> migration less attractive. Still, I'd be interested to hear whether you
>> see any value in a push-based approach at the LLC level, or if there
>> are related plans I should be aware of.
>
> I think that Chen is looking at using the push mechanism proposed here
> for cache-aware scheduling
> https://lore.kernel.org/all/as2-2b417B8ZaFdO@chenyu-dev/

Going forward, I will continue to follow your code and the CAS code, and I hope
I can contribute in some small way.

I'll step away for the weekend and circle back to this next week.

> Thanks
>
>>
>> --
>> thanks,
>> kunyu

--
thanks,
kunyu