From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752668AbcGSG6Q (ORCPT ); Tue, 19 Jul 2016 02:58:16 -0400 Received: from terminus.zytor.com ([198.137.202.10]:44550 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752470AbcGSG6M (ORCPT ); Tue, 19 Jul 2016 02:58:12 -0400 Date: Mon, 18 Jul 2016 23:57:44 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: peterz@infradead.org, tglx@linutronix.de, torvalds@linux-foundation.org, hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@kernel.org, anna-maria@linutronix.de Reply-To: mingo@kernel.org, anna-maria@linutronix.de, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, peterz@infradead.org, tglx@linutronix.de, hpa@zytor.com In-Reply-To: <20160713153332.896450738@linutronix.de> References: <20160713153332.896450738@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:smp/hotplug] cpu/hotplug: Handle early registration gracefully Git-Commit-ID: 6a4e24518c8a10f78f44da219835239cb5aca90d X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 6a4e24518c8a10f78f44da219835239cb5aca90d Gitweb: http://git.kernel.org/tip/6a4e24518c8a10f78f44da219835239cb5aca90d Author: Thomas Gleixner AuthorDate: Wed, 13 Jul 2016 17:16:03 +0000 Committer: Ingo Molnar 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 Signed-off-by: Anna-Maria Gleixner Cc: Linus Torvalds Cc: Peter Zijlstra Cc: rt@linutronix.de Link: http://lkml.kernel.org/r/20160713153332.896450738@linutronix.de Signed-off-by: Ingo Molnar --- 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; /*