Re: [PATCH 02/23] sched/isolation: Enhance housekeeping_update() to support updating more than one HK cpumask

sashiko-bot
2026-04-22T03:08:59Z

Sashiko AI review found 2 potential issue(s):
- [Low] The dummy static inline function for `housekeeping_update()` for `!CONFIG_CPU_ISOLATION` kernels was not updated with the new `flags` parameter.
- [Low] The `hk_types` mapping array is missing the `const` qualifier.
--

commit a7583f48d85bde2543fa30edd95c2d2d24ceae16
Author: Waiman Long <longman@redhat.com>

sched/isolation: Enhance housekeeping_update() to support updating more than one HK cpumask

This commit extends housekeeping_update to support updating multiple
housekeeping cpumasks simultaneously. It adds a new flags parameter to
pass the target housekeeping types and ensures the new mask is a subset
of the boot cpumask.

> diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolation.h
> index d1707f121e203..a17f16e0156e9 100644
> --- a/include/linux/sched/isolation.h
> +++ b/include/linux/sched/isolation.h
> @@ -51,7 +51,7 @@ extern const struct cpumask *housekeeping_cpumask(enum hk_type type);
> extern bool housekeeping_enabled(enum hk_type type);
> extern void housekeeping_affine(struct task_struct *t, enum hk_type type);
> extern bool housekeeping_test_cpu(int cpu, enum hk_type type);
> -extern int housekeeping_update(struct cpumask *isol_mask);
> +extern int housekeeping_update(struct cpumask *isol_mask, unsigned long flags);
> extern void __init housekeeping_init(void);
>
> #else

While the extern declaration in the CONFIG_CPU_ISOLATION block is updated,
is the dummy static inline fallback function in the #else block lower down
missing the new flags parameter?

It looks like it might still be defined as taking only the isol_mask
parameter, which would cause an API mismatch for builds without
CONFIG_CPU_ISOLATION.

[ ... ]

> diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c
> index 258601ad20113..c24215e05b7b2 100644
> --- a/kernel/sched/isolation.c
> +++ b/kernel/sched/isolation.c
[ ... ]
> +/* HK type processing table */
> +static struct {
> + int type;
> + int boot_type;
> +} hk_types[] = {
> + { HK_TYPE_DOMAIN, HK_TYPE_DOMAIN_BOOT },
> + { HK_TYPE_MANAGED_IRQ, HK_TYPE_MANAGED_IRQ_BOOT },
> + { HK_TYPE_KERNEL_NOISE, HK_TYPE_KERNEL_NOISE_BOOT }
> +};

This isn't a bug, but could this static array be marked as const so it is
placed in the read-only section instead of the mutable data section?

--
Sashiko AI review · https://sashiko.dev/#/patchset/20260421030351.281436-1-longman@redhat.com?part=2