[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-6a4e24518c8a10f78f44da219835239cb5aca90d@git.kernel.org>
Date: Mon, 18 Jul 2016 23:57:44 -0700
From: tip-bot for Thomas Gleixner <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: peterz@...radead.org, tglx@...utronix.de,
torvalds@...ux-foundation.org, hpa@...or.com,
linux-kernel@...r.kernel.org, mingo@...nel.org,
anna-maria@...utronix.de
Subject: [tip:smp/hotplug] cpu/hotplug: Handle early registration gracefully
Commit-ID: 6a4e24518c8a10f78f44da219835239cb5aca90d
Gitweb: http://git.kernel.org/tip/6a4e24518c8a10f78f44da219835239cb5aca90d
Author: Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Wed, 13 Jul 2016 17:16:03 +0000
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Thu, 14 Jul 2016 09:34:25 +0200
cpu/hotplug: Handle early registration gracefully
We switched the hotplug machinery to smpboot threads. Early registration of
hotplug callbacks, i.e. from do_pre_smp_initcalls(), happens before the
threads are initialized. Instead of moving the thread init, we simply handle
it in the hotplug code itself and invoke the function directly.
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@...utronix.de>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: rt@...utronix.de
Link: http://lkml.kernel.org/r/20160713153332.896450738@linutronix.de
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/cpu.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 7b61887..fe71ce4 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -517,6 +517,13 @@ static int cpuhp_invoke_ap_callback(int cpu, enum cpuhp_state state,
if (!cpu_online(cpu))
return 0;
+ /*
+ * If we are up and running, use the hotplug thread. For early calls
+ * we invoke the thread function directly.
+ */
+ if (!st->thread)
+ return cpuhp_invoke_callback(cpu, state, cb);
+
st->cb_state = state;
st->cb = cb;
/*
Powered by blists - more mailing lists