Le Mon, Apr 13, 2026 at 03:43:13PM +0800, Qiliang Yuan a écrit :
> Scheduler domains rely on HK_TYPE_DOMAIN to identify which CPUs are
> isolated from general load balancing. Currently, these boundaries are
> static and determined only during boot-time domain initialization.
> 
> Trigger a scheduler domain rebuild when the HK_TYPE_DOMAIN mask changes.
> 
> This ensures that scheduler isolation boundaries can be reconfigured
> at runtime via the DHEI sysfs or cpuset interface.
> 
> Signed-off-by: Qiliang Yuan <[email protected]>
> ---
>  kernel/sched/core.c | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 496dff740dcaf..b71c433bbc420 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -39,6 +39,7 @@
>  #include <linux/sched/nohz.h>
>  #include <linux/sched/rseq_api.h>
>  #include <linux/sched/rt.h>
> +#include <linux/sched/topology.h>
>  
>  #include <linux/blkdev.h>
>  #include <linux/context_tracking.h>
> @@ -10959,3 +10960,25 @@ void sched_change_end(struct sched_change_ctx *ctx)
>               p->sched_class->prio_changed(rq, p, ctx->prio);
>       }
>  }
> +
> +static int sched_housekeeping_update(struct notifier_block *nb,
> +                                  unsigned long action, void *data)
> +{
> +     struct housekeeping_update *update = data;
> +
> +     if (action == HK_UPDATE_MASK && update->type == HK_TYPE_DOMAIN)
> +             rebuild_sched_domains();
> +
> +     return NOTIFY_OK;
> +}

This is already handled by cpuset isolated partitions.

Thanks.

> +
> +static struct notifier_block sched_housekeeping_nb = {
> +     .notifier_call = sched_housekeeping_update,
> +};
> +
> +static int __init sched_housekeeping_init(void)
> +{
> +     housekeeping_register_notifier(&sched_housekeeping_nb);
> +     return 0;
> +}
> +late_initcall(sched_housekeeping_init);
> 
> -- 
> 2.43.0
> 

-- 
Frederic Weisbecker
SUSE Labs

Reply via email to