* Maksim Davydov <davydov-max@xxxxxxxxxxxxxx> 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