[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250901102642.GH4067720@noisy.programming.kicks-ass.net>
Date: Mon, 1 Sep 2025 12:26:42 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Frederic Weisbecker <frederic@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...hat.com>,
Marco Crivellari <marco.crivellari@...e.com>,
Michal Hocko <mhocko@...e.com>, Tejun Heo <tj@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Vlastimil Babka <vbabka@...e.cz>, Waiman Long <longman@...hat.com>
Subject: Re: [PATCH 01/33] sched/isolation: Remove housekeeping static key
On Fri, Aug 29, 2025 at 05:47:42PM +0200, Frederic Weisbecker wrote:
> +static inline bool housekeeping_cpu(int cpu, enum hk_type type)
> +{
> + if (housekeeping_flags & BIT(type))
> + return housekeeping_test_cpu(cpu, type);
> + else
> + return true;
> +}
That 'else' is superfluous.
> -static inline bool housekeeping_cpu(int cpu, enum hk_type type)
> -{
> -#ifdef CONFIG_CPU_ISOLATION
> - if (static_branch_unlikely(&housekeeping_overridden))
> - return housekeeping_test_cpu(cpu, type);
> -#endif
> - return true;
> -}
>
> static inline bool cpu_is_isolated(int cpu)
> {
> diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c
> index a4cf17b1fab0..2a6fc6fc46fb 100644
> --- a/kernel/sched/isolation.c
> +++ b/kernel/sched/isolation.c
> @@ -16,19 +16,13 @@ enum hk_flags {
> HK_FLAG_KERNEL_NOISE = BIT(HK_TYPE_KERNEL_NOISE),
> };
>
> -DEFINE_STATIC_KEY_FALSE(housekeeping_overridden);
> -EXPORT_SYMBOL_GPL(housekeeping_overridden);
> -
> -struct housekeeping {
> - cpumask_var_t cpumasks[HK_TYPE_MAX];
> - unsigned long flags;
> -};
> -
> -static struct housekeeping housekeeping;
> +static cpumask_var_t housekeeping_cpumasks[HK_TYPE_MAX];
> +unsigned long housekeeping_flags;
> +EXPORT_SYMBOL_GPL(housekeeping_flags);
I don't particularly like exporting variables much. It means modules can
actually change the value and things like that.
And while an exported static_key can be changed by modules, that's
fixable.
Powered by blists - more mailing lists