Re: [PATCHv5] sched/deadline: Walk up cpuset hierarchy to decide root domain when hot-unplug

From: Pingfan Liu

Date: Fri Nov 14 2025 - 06:28:19 EST


On Wed, Nov 12, 2025 at 12:18 PM Waiman Long <llong@xxxxxxxxxx> wrote:
>
> On 11/11/25 8:23 AM, Juri Lelli wrote:
>
> On 11/11/25 19:40, Pingfan Liu wrote:
>
> Hi Juri,
>
> Thanks for your review. Please see the comments below.
>
> ...
>
> Since there's no way to handle memory allocation failures, could it be
> done by using alloc_cpumask_var() in init_sched_dl_class() to reserve
> the memory for this purpose?
>
> Maybe something similar to local_cpu_mask_dl (or use local_cpu_mask_dl
> directly?), I'm thinking.
>
> local_cpu_mask_dl is used in find_later_rq() which is called by select_task_rq_dl() and find_lock_later_rq(). The scheduler core will call these class methods after acquiring a pi_lock with interrupt disabled. It is the interrupt disabled part that protects that percpu cpumask. Since dl_get_task_effective_cpus() is also called after acquiring the pi_lock with interrupt disabled, we can use it as a temporary cpumask_var_t.
>

Thanks Juri and Waiman, I will use this approach to resolve the
cpumask allocation issue.

As for the spin_lock issue (sleepable on RT under pi_lock), I'll use a
lock-free variant of cpuset_cpus_allowed().

Thanks,

Pingfan