From: Helge Deller <deller@gmx.de>
To: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: linux-kernel@vger.kernel.org, James Morse <james.morse@arm.com>,
Jonathan Cameron <Jonathan.Cameron@Huawei.com>,
Salil Mehta <salil.mehta@huawei.com>,
linux-parisc@vger.kernel.org
Subject: Re: [PATCH] parisc: simplify smp_prepare_boot_cpu()
Date: Sat, 21 Oct 2023 09:20:57 +0200 [thread overview]
Message-ID: <b25c8ea1-efcd-4861-a9b4-5db89ccc7070@gmx.de> (raw)
In-Reply-To: <E1qtqkk-00AJHA-1u@rmk-PC.armlinux.org.uk>
On 10/20/23 16:45, Russell King (Oracle) wrote:
> smp_prepare_boot_cpu() reads the cpuid of the first CPU, printing a
> message to state which processor booted, and setting it online and
> present.
>
> This cpuid is retrieved from per_cpu(cpu_data, 0).cpuid, which is
> initialised in arch/parisc/kernel/processor.c:processor_probe() thusly:
>
> p = &per_cpu(cpu_data, cpuid);
> ...
> p->cpuid = cpuid; /* save CPU id */
>
> Consequently, the cpuid retrieved seems to be guaranteed to also be
> zero, meaning that the message printed in this boils down to:
>
> pr_info("SMP: bootstrap CPU ID is 0\n");
>
> Moreover, since kernel/cpu.c::boot_cpu_init() already sets CPU 0 to
> be present and online, there is no need to do this again in
> smp_prepare_boot_cpu().
>
> Remove this code, and simplify the printk().
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
applied.
Removed the "Setup BSP mappings" comment too, as
Jonathan Cameron suggested.
Thank you!
Helge
> ---
> arch/parisc/kernel/smp.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
> index 2019c1f04bd0..989efc8c67a5 100644
> --- a/arch/parisc/kernel/smp.c
> +++ b/arch/parisc/kernel/smp.c
> @@ -404,13 +404,8 @@ static int smp_boot_one_cpu(int cpuid, struct task_struct *idle)
>
> void __init smp_prepare_boot_cpu(void)
> {
> - int bootstrap_processor = per_cpu(cpu_data, 0).cpuid;
> -
> /* Setup BSP mappings */
> - printk(KERN_INFO "SMP: bootstrap CPU ID is %d\n", bootstrap_processor);
> -
> - set_cpu_online(bootstrap_processor, true);
> - set_cpu_present(bootstrap_processor, true);
> + pr_info("SMP: bootstrap CPU ID is 0\n");
> }
>
>
prev parent reply other threads:[~2023-10-21 7:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-20 14:45 [PATCH] parisc: simplify smp_prepare_boot_cpu() Russell King (Oracle)
2023-10-20 14:50 ` Jonathan Cameron
2023-10-21 7:20 ` Helge Deller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b25c8ea1-efcd-4861-a9b4-5db89ccc7070@gmx.de \
--to=deller@gmx.de \
--cc=James.Bottomley@HansenPartnership.com \
--cc=Jonathan.Cameron@Huawei.com \
--cc=james.morse@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=rmk+kernel@armlinux.org.uk \
--cc=salil.mehta@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).