From: Catalin Marinas <catalin.marinas@arm.com>
To: Pingfan Liu <kernelfans@gmail.com>
Cc: linux-ia64@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Thomas Gleixner <tglx@linutronix.de>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Peter Zijlstra <peterz@infradead.org>,
Kees Cook <keescook@chromium.org>, Jens Axboe <axboe@kernel.dk>,
Russell King <linux@armlinux.org.uk>,
Guenter Roeck <linux@roeck-us.net>, Arnd Bergmann <arnd@arndb.de>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Lee Jones <lee.jones@linaro.org>, Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Peter Collingbourne <pcc@google.com>,
Marc Zyngier <maz@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCHv4 2/2] cpu/hotplug: Remove the input parameter primary_cpu of smp_shutdown_nonboot_cpus()
Date: Sun, 15 May 2022 10:03:13 +0000 [thread overview]
Message-ID: <YoDP4aYg7vdUg4sO@arm.com> (raw)
In-Reply-To: <20220512030619.13426-3-kernelfans@gmail.com>
On Thu, May 12, 2022 at 11:06:19AM +0800, Pingfan Liu wrote:
> For all call sites of smp_shutdown_nonboot_cpus(),
>
> $git grep smp_shutdown_nonboot_cpus -- arch | grep -v \*
> arch/arm/kernel/reboot.c:94: smp_shutdown_nonboot_cpus(reboot_cpu);
> arch/arm64/kernel/process.c:89: smp_shutdown_nonboot_cpus(reboot_cpu);
> arch/ia64/kernel/process.c:578: smp_shutdown_nonboot_cpus(reboot_cpu);
> arch/riscv/kernel/machine_kexec.c:135: smp_shutdown_nonboot_cpus(smp_processor_id());
>
> As it shows, the input parameter seems a little arbitrary.
>
> Since kernel_kexec()->migrate_to_reboot_cpu() has already pinned the
> rebooting thread on the selected CPU and the CPU hotplug keeps disabled
> before smp_shutdown_nonboot_cpus(). Let smp_shutdown_nonboot_cpus()
> deduce the rebooting CPU by smp_processor_id(), instead of passing the
> parameter primary_cpu to it.
>
> As a result, all call sites look consistent.
>
> Signed-off-by: Pingfan Liu <kernelfans@gmail.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Jens Axboe <axboe@kernel.dk>
> To: linux-ia64@vger.kernel.org
> Cc: Russell King <linux@armlinux.org.uk>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Peter Collingbourne <pcc@google.com>
> Cc: Marc Zyngier <maz@kernel.org>
> To: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
For arm64:
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
WARNING: multiple messages have this Message-ID (diff)
From: Catalin Marinas <catalin.marinas@arm.com>
To: Pingfan Liu <kernelfans@gmail.com>
Cc: linux-ia64@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Thomas Gleixner <tglx@linutronix.de>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Peter Zijlstra <peterz@infradead.org>,
Kees Cook <keescook@chromium.org>, Jens Axboe <axboe@kernel.dk>,
Russell King <linux@armlinux.org.uk>,
Guenter Roeck <linux@roeck-us.net>, Arnd Bergmann <arnd@arndb.de>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Lee Jones <lee.jones@linaro.org>, Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Peter Collingbourne <pcc@google.com>,
Marc Zyngier <maz@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCHv4 2/2] cpu/hotplug: Remove the input parameter primary_cpu of smp_shutdown_nonboot_cpus()
Date: Sun, 15 May 2022 11:03:13 +0100 [thread overview]
Message-ID: <YoDP4aYg7vdUg4sO@arm.com> (raw)
In-Reply-To: <20220512030619.13426-3-kernelfans@gmail.com>
On Thu, May 12, 2022 at 11:06:19AM +0800, Pingfan Liu wrote:
> For all call sites of smp_shutdown_nonboot_cpus(),
>
> $git grep smp_shutdown_nonboot_cpus -- arch | grep -v \*
> arch/arm/kernel/reboot.c:94: smp_shutdown_nonboot_cpus(reboot_cpu);
> arch/arm64/kernel/process.c:89: smp_shutdown_nonboot_cpus(reboot_cpu);
> arch/ia64/kernel/process.c:578: smp_shutdown_nonboot_cpus(reboot_cpu);
> arch/riscv/kernel/machine_kexec.c:135: smp_shutdown_nonboot_cpus(smp_processor_id());
>
> As it shows, the input parameter seems a little arbitrary.
>
> Since kernel_kexec()->migrate_to_reboot_cpu() has already pinned the
> rebooting thread on the selected CPU and the CPU hotplug keeps disabled
> before smp_shutdown_nonboot_cpus(). Let smp_shutdown_nonboot_cpus()
> deduce the rebooting CPU by smp_processor_id(), instead of passing the
> parameter primary_cpu to it.
>
> As a result, all call sites look consistent.
>
> Signed-off-by: Pingfan Liu <kernelfans@gmail.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Jens Axboe <axboe@kernel.dk>
> To: linux-ia64@vger.kernel.org
> Cc: Russell King <linux@armlinux.org.uk>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Peter Collingbourne <pcc@google.com>
> Cc: Marc Zyngier <maz@kernel.org>
> To: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
For arm64:
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Catalin Marinas <catalin.marinas@arm.com>
To: Pingfan Liu <kernelfans@gmail.com>
Cc: linux-ia64@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Thomas Gleixner <tglx@linutronix.de>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Peter Zijlstra <peterz@infradead.org>,
Kees Cook <keescook@chromium.org>, Jens Axboe <axboe@kernel.dk>,
Russell King <linux@armlinux.org.uk>,
Guenter Roeck <linux@roeck-us.net>, Arnd Bergmann <arnd@arndb.de>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Lee Jones <lee.jones@linaro.org>, Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Peter Collingbourne <pcc@google.com>,
Marc Zyngier <maz@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCHv4 2/2] cpu/hotplug: Remove the input parameter primary_cpu of smp_shutdown_nonboot_cpus()
Date: Sun, 15 May 2022 11:03:13 +0100 [thread overview]
Message-ID: <YoDP4aYg7vdUg4sO@arm.com> (raw)
In-Reply-To: <20220512030619.13426-3-kernelfans@gmail.com>
On Thu, May 12, 2022 at 11:06:19AM +0800, Pingfan Liu wrote:
> For all call sites of smp_shutdown_nonboot_cpus(),
>
> $git grep smp_shutdown_nonboot_cpus -- arch | grep -v \*
> arch/arm/kernel/reboot.c:94: smp_shutdown_nonboot_cpus(reboot_cpu);
> arch/arm64/kernel/process.c:89: smp_shutdown_nonboot_cpus(reboot_cpu);
> arch/ia64/kernel/process.c:578: smp_shutdown_nonboot_cpus(reboot_cpu);
> arch/riscv/kernel/machine_kexec.c:135: smp_shutdown_nonboot_cpus(smp_processor_id());
>
> As it shows, the input parameter seems a little arbitrary.
>
> Since kernel_kexec()->migrate_to_reboot_cpu() has already pinned the
> rebooting thread on the selected CPU and the CPU hotplug keeps disabled
> before smp_shutdown_nonboot_cpus(). Let smp_shutdown_nonboot_cpus()
> deduce the rebooting CPU by smp_processor_id(), instead of passing the
> parameter primary_cpu to it.
>
> As a result, all call sites look consistent.
>
> Signed-off-by: Pingfan Liu <kernelfans@gmail.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Jens Axboe <axboe@kernel.dk>
> To: linux-ia64@vger.kernel.org
> Cc: Russell King <linux@armlinux.org.uk>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Peter Collingbourne <pcc@google.com>
> Cc: Marc Zyngier <maz@kernel.org>
> To: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
For arm64:
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
next prev parent reply other threads:[~2022-05-15 10:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-12 3:06 [PATCHv4 0/2] cpu/hotplug: Keep cpu hotplug disabled until the rebooting cpu is stable Pingfan Liu
2022-05-12 3:06 ` Pingfan Liu
2022-05-12 3:06 ` [PATCHv4 1/2] " Pingfan Liu
2022-05-12 3:06 ` Pingfan Liu
2022-05-12 3:06 ` Pingfan Liu
2022-05-12 3:06 ` [PATCHv4 2/2] cpu/hotplug: Remove the input parameter primary_cpu of smp_shutdown_nonboot_cpus() Pingfan Liu
2022-05-12 3:06 ` Pingfan Liu
2022-05-12 3:06 ` Pingfan Liu
2022-05-15 10:03 ` Catalin Marinas [this message]
2022-05-15 10:03 ` Catalin Marinas
2022-05-15 10:03 ` Catalin Marinas
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=YoDP4aYg7vdUg4sO@arm.com \
--to=catalin.marinas@arm.com \
--cc=arnd@arndb.de \
--cc=axboe@kernel.dk \
--cc=geert@linux-m68k.org \
--cc=keescook@chromium.org \
--cc=kernelfans@gmail.com \
--cc=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=linux@roeck-us.net \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=pcc@google.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=will@kernel.org \
--cc=wsa+renesas@sang-engineering.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.