Re: [RFC PATCH 5/6] sched/isolation: Make HK_FLAG_DOMAIN mutable

From: Vincent Donnefort
Date: Wed Jul 21 2021 - 10:28:56 EST


Hi Frederic,

[...]

>
> +// Only support HK_FLAG_DOMAIN for now
> +// TODO: propagate the changes through all interested subsystems:
> +// workqueues, net, pci; ...
> +void housekeeping_cpumask_set(struct cpumask *mask, enum hk_flags flags)
> +{
> + /* Only HK_FLAG_DOMAIN change supported for now */
> + if (WARN_ON_ONCE(flags != HK_FLAG_DOMAIN))
> + return;
>
> + if (!static_key_enabled(&housekeeping_overridden.key)) {
> + if (cpumask_equal(mask, cpu_possible_mask))
> + return;
> + if (WARN_ON_ONCE(!alloc_cpumask_var(&hk_domain_mask, GFP_KERNEL)))
> + return;
> + cpumask_copy(hk_domain_mask, mask);
> + static_branch_enable(&housekeeping_overridden);

I get a warning here. static_branch_enable() is trying to take cpus_read_lock().
But the same lock is already taken by cpuset_write_u64().

Also, shouldn't it set HK_FLAG_DOMAIN in housekeeping_flags to enable
housekeeping if the kernel started without isolcpus="" ?

--
Vincent