Re: [PATCH 02/10] sched/fair: Add rate-limiting and validation helpers

From: Wanpeng Li

Date: Thu Nov 13 2025 - 08:37:00 EST


Hi Prateek,

On Wed, 12 Nov 2025 at 14:44, K Prateek Nayak <kprateek.nayak@xxxxxxx> wrote:
>
> On 11/12/2025 12:10 PM, K Prateek Nayak wrote:
> >> + if (task_rq(p_yielding) != rq || task_rq(p_target) != rq)
> >
> > yield_to() has already checked for this under double_rq_lock()
> > so this too should be unnecessary.
>
> nvm! We only check if the task_rq(p_target) is stable under the
> rq_lock or not. Just checking "task_rq(p_target) != rq" should
> be sufficient here.

You're right! Since yield_to() passes rq = this_rq() , the yielding
task is guaranteed on rq . But p_target may be on a different CPU
(yield_to supports cross-CPU). Our deboost only works for same-rq
tasks, so checking only task_rq(p_target) != rq is sufficient. I'll
remove the redundant task_rq(p_yielding) != rq check. Thanks!

Regards,
Wanpeng