Re: [RFC PATCH] sched/fair: Refactor can_migrate_task() to elimate looping

From: I Hsin Cheng
Date: Thu Jan 09 2025 - 10:24:02 EST


On Thu, Jan 09, 2025 at 11:21:22AM +0100, Peter Zijlstra wrote:
> On Thu, Jan 09, 2025 at 06:12:22PM +0800, I Hsin Cheng wrote:
>
> > > > Except you cannot put cpumask on-stack...
> >
> > Oh I'm sorry, may I ask the reason? is it because cpumask tends to be
> > very large?
>
> Yes, when building with NR_CPUS=8192 (as Distos tend to do) it is 1K of
> stack space.
>

Thanks for your explanation! I've made the requested changes using
"cpumask_first_and_and()" so there won't be additional cpumask needed.
Tests are done and I'm sending a v2 rfc patch.

-- Richard.