From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752811AbcGSG6o (ORCPT ); Tue, 19 Jul 2016 02:58:44 -0400 Received: from terminus.zytor.com ([198.137.202.10]:44574 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752421AbcGSG6l (ORCPT ); Tue, 19 Jul 2016 02:58:41 -0400 Date: Mon, 18 Jul 2016 23:58:11 -0700 From: tip-bot for Sebastian Andrzej Siewior Message-ID: Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@kernel.org, torvalds@linux-foundation.org, bigeasy@linutronix.de, tglx@linutronix.de, anna-maria@linutronix.de, luto@amacapital.net, peterz@infradead.org Reply-To: hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@kernel.org, bigeasy@linutronix.de, torvalds@linux-foundation.org, tglx@linutronix.de, anna-maria@linutronix.de, peterz@infradead.org, luto@amacapital.net In-Reply-To: <20160713153332.987560239@linutronix.de> References: <20160713153332.987560239@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:smp/hotplug] x86/vdso: Convert to hotplug state machine Git-Commit-ID: 07d36c9e84002678d75b97d2361eb6302a718359 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: 07d36c9e84002678d75b97d2361eb6302a718359 Gitweb: http://git.kernel.org/tip/07d36c9e84002678d75b97d2361eb6302a718359 Author: Sebastian Andrzej Siewior AuthorDate: Wed, 13 Jul 2016 17:16:03 +0000 Committer: Ingo Molnar CommitDate: Thu, 14 Jul 2016 09:34:27 +0200 x86/vdso: Convert to hotplug state machine Install the callbacks via the state machine and let the core invoke the callbacks on the already online CPUs. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Anna-Maria Gleixner Acked-by: Andy Lutomirski Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: rt@linutronix.de Link: http://lkml.kernel.org/r/20160713153332.987560239@linutronix.de Signed-off-by: Ingo Molnar --- arch/x86/entry/vdso/vma.c | 20 ++++---------------- include/linux/cpuhotplug.h | 1 + 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c index ab220ac..25b0368 100644 --- a/arch/x86/entry/vdso/vma.c +++ b/arch/x86/entry/vdso/vma.c @@ -294,15 +294,9 @@ static void vgetcpu_cpu_init(void *arg) write_gdt_entry(get_cpu_gdt_table(cpu), GDT_ENTRY_PER_CPU, &d, DESCTYPE_S); } -static int -vgetcpu_cpu_notifier(struct notifier_block *n, unsigned long action, void *arg) +static int vgetcpu_online(unsigned int cpu) { - long cpu = (long)arg; - - if (action == CPU_ONLINE || action == CPU_ONLINE_FROZEN) - smp_call_function_single(cpu, vgetcpu_cpu_init, NULL, 1); - - return NOTIFY_DONE; + return smp_call_function_single(cpu, vgetcpu_cpu_init, NULL, 1); } static int __init init_vdso(void) @@ -313,15 +307,9 @@ static int __init init_vdso(void) init_vdso_image(&vdso_image_x32); #endif - cpu_notifier_register_begin(); - - on_each_cpu(vgetcpu_cpu_init, NULL, 1); /* notifier priority > KVM */ - __hotcpu_notifier(vgetcpu_cpu_notifier, 30); - - cpu_notifier_register_done(); - - return 0; + return cpuhp_setup_state(CPUHP_AP_X86_VDSO_VMA_ONLINE, + "AP_X86_VDSO_VMA_ONLINE", vgetcpu_online, NULL); } subsys_initcall(init_vdso); #endif /* CONFIG_X86_64 */ diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h index 386374d..fe05640 100644 --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h @@ -14,6 +14,7 @@ enum cpuhp_state { CPUHP_TEARDOWN_CPU, CPUHP_AP_ONLINE_IDLE, CPUHP_AP_SMPBOOT_THREADS, + CPUHP_AP_X86_VDSO_VMA_ONLINE, CPUHP_AP_NOTIFY_ONLINE, CPUHP_AP_ONLINE_DYN, CPUHP_AP_ONLINE_DYN_END = CPUHP_AP_ONLINE_DYN + 30,