Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp545345ybb; Wed, 25 Mar 2020 05:07:04 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvqOZhhSyWNqoNmIRsJuJPiyARze8c7B6fCIKkiJfNn3JLs6l7AIN36cvOP97h/aqDrZb5D X-Received: by 2002:aca:fd48:: with SMTP id b69mr2180040oii.126.1585138024881; Wed, 25 Mar 2020 05:07:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585138024; cv=none; d=google.com; s=arc-20160816; b=AMkAAZ+GbXQnZFWWT5ce0ZqueEVTPCXB1PymNw9qfCScjKRGUIumiQcaaFEUwMy+Bv lC8xwjwnNHzTcFW7NNNY6YMY8ZZMu8pv1y6Cn9O0y69k8d22G41S4aGXjBgjNkKmLTdM 3aAfs4YszQRz0IdB2mN3Dsaw5kilM1mdI00g49SM7vz71kjUQb3vbUPvwC1GHJivZLJs O+kc9sFCjdcf2ghZTMZTYeJRlL3zxdV8Sh6pCZG6tIibpPkODLTNYJtqMf/oLGOd0WoZ atE99QBAKO0UXDmU6M4SvXxneA9M/XuUPWAUqthGH0tlv6NkHSMYkoSpXlWNiU0HtZRC N3yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=dM6miYHL4QvAZW2jduDfxmu0m9Ho/o6/MgiHtv1L/T4=; b=GmHH5AnZPqVlN7BbtonFNgNEcDbaATSTF/VHdnMJ7W/e9tlysDn8OI83MQ6BqIhedP 9zWRYsnowN/wH8fglss/KdnshOH5VSWyPauzlhvgqLj9GmRDxlCxJE8BieF0sXIjhHSn zO3l3Trnjbb3CMEniMYFjj5XJJwzE5cb8atG+1ZOMrCQ1+1N4p+9Kxf8M9O+FHD33bke /PThBuHzp884P89K21oFhMuvvLRQbu04ocHb2KkJI7jld75VMzhEQ1/z7e0bmrhPUgg2 ujKqan7e9mU1Ia/lNtm63R+34hfKg/QI/3JcGtPSDMhXXxugQLaO1Tnt8ivmg/Zi5Pu7 58pQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s5si9856925oie.153.2020.03.25.05.06.47; Wed, 25 Mar 2020 05:07:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727563AbgCYMGL (ORCPT + 99 others); Wed, 25 Mar 2020 08:06:11 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:47736 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727501AbgCYMGJ (ORCPT ); Wed, 25 Mar 2020 08:06:09 -0400 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jH4nJ-0000hp-8M; Wed, 25 Mar 2020 13:06:01 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id CF5261C0470; Wed, 25 Mar 2020 13:06:00 +0100 (CET) Date: Wed, 25 Mar 2020 12:06:00 -0000 From: "tip-bot2 for Qais Yousef" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: smp/core] cpu/hotplug: Move bringup of secondary CPUs out of smp_init() Cc: Qais Yousef , Thomas Gleixner , x86 , LKML In-Reply-To: <20200323135110.30522-17-qais.yousef@arm.com> References: <20200323135110.30522-17-qais.yousef@arm.com> MIME-Version: 1.0 Message-ID: <158513796050.28353.7961406059999182214.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the smp/core branch of tip: Commit-ID: b99a26593b5190fac6b5c1f81a7f8cc128a25c98 Gitweb: https://git.kernel.org/tip/b99a26593b5190fac6b5c1f81a7f8cc128a25c98 Author: Qais Yousef AuthorDate: Mon, 23 Mar 2020 13:51:09 Committer: Thomas Gleixner CommitterDate: Wed, 25 Mar 2020 12:59:37 +01:00 cpu/hotplug: Move bringup of secondary CPUs out of smp_init() This is the last direct user of cpu_up() before it can become an internal implementation detail of the cpu subsystem. Signed-off-by: Qais Yousef Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200323135110.30522-17-qais.yousef@arm.com --- include/linux/cpu.h | 1 + kernel/cpu.c | 12 ++++++++++++ kernel/smp.c | 9 +-------- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 9dc1e89..8b295f7 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -94,6 +94,7 @@ void notify_cpu_starting(unsigned int cpu); extern void cpu_maps_update_begin(void); extern void cpu_maps_update_done(void); int bringup_hibernate_cpu(unsigned int sleep_cpu); +void bringup_nonboot_cpus(unsigned int setup_max_cpus); #else /* CONFIG_SMP */ #define cpuhp_tasks_frozen 0 diff --git a/kernel/cpu.c b/kernel/cpu.c index f803678..4783d81 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -1298,6 +1298,18 @@ int bringup_hibernate_cpu(unsigned int sleep_cpu) return 0; } +void bringup_nonboot_cpus(unsigned int setup_max_cpus) +{ + unsigned int cpu; + + for_each_present_cpu(cpu) { + if (num_online_cpus() >= setup_max_cpus) + break; + if (!cpu_online(cpu)) + cpu_up(cpu); + } +} + #ifdef CONFIG_PM_SLEEP_SMP static cpumask_var_t frozen_cpus; diff --git a/kernel/smp.c b/kernel/smp.c index 97f1d97..786092a 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -597,20 +597,13 @@ void __init setup_nr_cpu_ids(void) void __init smp_init(void) { int num_nodes, num_cpus; - unsigned int cpu; idle_threads_init(); cpuhp_threads_init(); pr_info("Bringing up secondary CPUs ...\n"); - /* FIXME: This should be done in userspace --RR */ - for_each_present_cpu(cpu) { - if (num_online_cpus() >= setup_max_cpus) - break; - if (!cpu_online(cpu)) - cpu_up(cpu); - } + bringup_nonboot_cpus(setup_max_cpus); num_nodes = num_online_nodes(); num_cpus = num_online_cpus();