Re: [PATCH 4/4] sched/fair: Add more core cookie check in wake up fast path

K Prateek Nayak
2025-09-24T04:21:41Z

Hello Fernand,

On 9/23/2025 3:00 PM, Fernand Sieber wrote:
> Hi Prateek,
>
> On 9/23/2025 2:25 PM, K Prateek Nayak wrote:
>> So with Patch 1, you already check for cookie matching while entering
>> select_idle_smt() and now, each pass of the loop again does a
>> sched_core_cookie_match() which internally loops through the smt mask
>> again! Seems wasteful.
>
> Right. The change in select_idle_smt() is unnecessary.
>
>> On an SMT-8 system, all the looping over smt mask per wakeup will add
>> up. Is that not a concern? A single task with core cookie enabled will
>> add massive overhead for all wakeup in the system.
>
> In such a scenario there should generally be no looping because I introduced an
> early return in patch 3 in __sched_core_cookie_match(). Perhaps it's worth
> extracting this early return as standalone optimization patch? Something like
> this:

Yes, that would be great! Thank you. And also please include some
benchmark numbers either in improved core utilization or the benchmark
results actually improving from these changes.

It would be great to know how much things improve by :)

--
Thanks and Regards,
Prateek