[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z-J2jnHK6_ltAdfR@gmail.com>
Date: Tue, 25 Mar 2025 10:25:34 +0100
From: Ingo Molnar <mingo@...nel.org>
To: Maksim Davydov <davydov-max@...dex-team.ru>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org,
den-plotnikov@...dex-team.ru, gpiccoli@...lia.com, mingo@...hat.com,
bp@...en8.de, dave.hansen@...ux.intel.com, tglx@...utronix.de,
hpa@...or.com
Subject: Re: [PATCH] x86/split_lock: simplify reenabling
* Maksim Davydov <davydov-max@...dex-team.ru> wrote:
> sld_setup() is called before setup_per_cpu_areas(), thus it can't be
> used for this purpose. Another way is to implement independent
> initcall for the initialization, that's what has been done.
> + * Per-CPU delayed_work can't be statically initialized properly because
> + * the struct address is unknown. Thus per-CPU delayed_work structures
> + * have to be initialized during kernel initialization and after calling
> + * setup_per_cpu_areas().
> + */
> +static int __init setup_split_lock_delayed_work(void)
> +{
> + unsigned int cpu;
> +
> + for_each_possible_cpu(cpu) {
> + struct delayed_work *work = per_cpu_ptr(&sl_reenable, cpu);
> +
> + INIT_DELAYED_WORK(work, __split_lock_reenable);
> + }
> +
> + return 0;
> +}
> +pure_initcall(setup_split_lock_delayed_work);
Oh, I didn't realize sld_setup() couldn't be used for this - thx for
the followup!
Ingo
Powered by blists - more mailing lists