[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aQTXYSyPS65nhkvl@localhost.localdomain>
Date: Fri, 31 Oct 2025 16:36:01 +0100
From: Frederic Weisbecker <frederic@...nel.org>
To: Valentin Schneider <vschneid@...hat.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Michal Koutný <mkoutny@...e.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Catalin Marinas <catalin.marinas@....com>,
Danilo Krummrich <dakr@...nel.org>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Gabriele Monaco <gmonaco@...hat.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Ingo Molnar <mingo@...hat.com>, Jakub Kicinski <kuba@...nel.org>,
Jens Axboe <axboe@...nel.dk>, Johannes Weiner <hannes@...xchg.org>,
Lai Jiangshan <jiangshanlai@...il.com>,
Marco Crivellari <marco.crivellari@...e.com>,
Michal Hocko <mhocko@...e.com>, Muchun Song <muchun.song@...ux.dev>,
Paolo Abeni <pabeni@...hat.com>,
Peter Zijlstra <peterz@...radead.org>, Phil Auld <pauld@...hat.com>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Shakeel Butt <shakeel.butt@...ux.dev>,
Simon Horman <horms@...nel.org>, Tejun Heo <tj@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Vlastimil Babka <vbabka@...e.cz>, Waiman Long <longman@...hat.com>,
Will Deacon <will@...nel.org>, cgroups@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-block@...r.kernel.org,
linux-mm@...ck.org, linux-pci@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH 05/33] sched/isolation: Save boot defined domain flags
Le Thu, Oct 23, 2025 at 05:45:40PM +0200, Valentin Schneider a écrit :
> On 13/10/25 22:31, Frederic Weisbecker wrote:
> > HK_TYPE_DOMAIN will soon integrate not only boot defined isolcpus= CPUs
> > but also cpuset isolated partitions.
> >
> > Housekeeping still needs a way to record what was initially passed
> > to isolcpus= in order to keep these CPUs isolated after a cpuset
> > isolated partition is modified or destroyed while containing some of
> > them.
> >
> > Create a new HK_TYPE_DOMAIN_BOOT to keep track of those.
> >
> > Signed-off-by: Frederic Weisbecker <frederic@...nel.org>
> > Reviewed-by: Phil Auld <pauld@...hat.com>
> > ---
> > include/linux/sched/isolation.h | 1 +
> > kernel/sched/isolation.c | 5 +++--
> > 2 files changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolation.h
> > index d8501f4709b5..da22b038942a 100644
> > --- a/include/linux/sched/isolation.h
> > +++ b/include/linux/sched/isolation.h
> > @@ -7,6 +7,7 @@
> > #include <linux/tick.h>
> >
> > enum hk_type {
> > + HK_TYPE_DOMAIN_BOOT,
> > HK_TYPE_DOMAIN,
> > HK_TYPE_MANAGED_IRQ,
> > HK_TYPE_KERNEL_NOISE,
> > diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c
> > index a4cf17b1fab0..8690fb705089 100644
> > --- a/kernel/sched/isolation.c
> > +++ b/kernel/sched/isolation.c
> > @@ -11,6 +11,7 @@
> > #include "sched.h"
> >
> > enum hk_flags {
> > + HK_FLAG_DOMAIN_BOOT = BIT(HK_TYPE_DOMAIN_BOOT),
> > HK_FLAG_DOMAIN = BIT(HK_TYPE_DOMAIN),
> > HK_FLAG_MANAGED_IRQ = BIT(HK_TYPE_MANAGED_IRQ),
> > HK_FLAG_KERNEL_NOISE = BIT(HK_TYPE_KERNEL_NOISE),
> > @@ -216,7 +217,7 @@ static int __init housekeeping_isolcpus_setup(char *str)
> >
> > if (!strncmp(str, "domain,", 7)) {
> > str += 7;
> > - flags |= HK_FLAG_DOMAIN;
> > + flags |= HK_FLAG_DOMAIN | HK_FLAG_DOMAIN_BOOT;
> > continue;
> > }
> >
> > @@ -246,7 +247,7 @@ static int __init housekeeping_isolcpus_setup(char *str)
> >
> > /* Default behaviour for isolcpus without flags */
> > if (!flags)
> > - flags |= HK_FLAG_DOMAIN;
> > + flags |= HK_FLAG_DOMAIN | HK_FLAG_DOMAIN_BOOT;
>
> I got stupidly confused by the cpumask_andnot() used later on since these
> are housekeeping cpumasks and not isolated ones; AFAICT HK_FLAG_DOMAIN_BOOT
> is meant to be a superset of HK_FLAG_DOMAIN - or, put in a way my brain
> comprehends, NOT(HK_FLAG_DOMAIN) (i.e. runtime isolated cpumask) is a
> superset of NOT(HK_FLAG_DOMAIN_BOOT) (i.e. boottime isolated cpumask),
> thus the final shape of cpu_is_isolated() makes sense:
>
> static inline bool cpu_is_isolated(int cpu)
> {
> return !housekeeping_test_cpu(cpu, HK_TYPE_DOMAIN);
> }
Right, I get confused myself as well. I've been thinking several times about
inverting those housekeeping masks to work instead with isolated masks. But I'm
not sure that would make the APIs easier to use.
> Could we document that to make it a bit more explicit? Maybe something like
>
> enum hk_type {
> /* Set at boot-time via the isolcpus= cmdline argument */
> HK_TYPE_DOMAIN_BOOT,
> /*
> * Updated at runtime via isolated cpusets; strict subset of
> * HK_TYPE_DOMAIN_BOOT as it accounts for boot-time isolated CPUs.
> */
> HK_TYPE_DOMAIN,
> ...
> }
I thought I did already but obviously not. Let me fix that...
Thanks.
--
Frederic Weisbecker
SUSE Labs
Powered by blists - more mailing lists