From: Greg KH <gregkh@linuxfoundation.org>
To: Huacai Chen <chenhuacai@gmail.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
"open list:MIPS" <linux-mips@vger.kernel.org>,
Fuxin Zhang <zhangfx@lemote.com>,
Zhangjin Wu <wuzhangjin@gmail.com>,
Jiaxun Yang <jiaxun.yang@flygoat.com>,
stable <stable@vger.kernel.org>
Subject: Re: [PATCH V2] MIPS: CPU#0 is not hotpluggable
Date: Sat, 25 Jul 2020 08:49:23 +0200 [thread overview]
Message-ID: <20200725064923.GA1059787@kroah.com> (raw)
In-Reply-To: <CAAhV-H4QH-cyabcfYyNJv89LpOdpsXN+dpZBYy0gNKmSnsUsKA@mail.gmail.com>
On Sat, Jul 25, 2020 at 02:37:52PM +0800, Huacai Chen wrote:
> Hi, Thomas,
>
> What do you think about this patch? Other archs also do the same thing
> except those support hotplug CPU#0.
>
> grep hotpluggable arch -rwI
> arch/riscv/kernel/setup.c: cpu->hotpluggable = cpu_has_hotplug(i);
> arch/powerpc/kernel/sysfs.c: BUG_ON(!c->hotpluggable);
> arch/powerpc/kernel/sysfs.c: c->hotpluggable = 1;
> arch/powerpc/kernel/sysfs.c: if (cpu_online(cpu) || c->hotpluggable) {
> arch/arm/kernel/setup.c: cpuinfo->cpu.hotpluggable =
> platform_can_hotplug_cpu(cpu);
> arch/sh/kernel/topology.c: c->hotpluggable = 1;
> arch/ia64/kernel/topology.c: * CPEI target, then it is hotpluggable
> arch/ia64/kernel/topology.c: sysfs_cpus[num].cpu.hotpluggable = 1;
> arch/xtensa/kernel/setup.c: cpu->hotpluggable = !!i;
> arch/s390/kernel/smp.c: c->hotpluggable = 1;
> arch/mips/kernel/topology.c: c->hotpluggable = 1;
> arch/arm64/kernel/cpuinfo.c: * In case the boot CPU is hotpluggable,
> we record its initial state and
> arch/arm64/kernel/setup.c: cpu->hotpluggable = cpu_can_disable(i);
> arch/x86/kernel/topology.c: per_cpu(cpu_devices,
> num).cpu.hotpluggable = 1;
>
> On Thu, Jul 16, 2020 at 6:38 PM Huacai Chen <chenhc@lemote.com> wrote:
> >
> > Now CPU#0 is not hotpluggable on MIPS, so prevent to create /sys/devices
> > /system/cpu/cpu0/online which confuses some user-space tools.
What userspace tools are confused by this? They should be able to
handle a cpu not being able to be removed, right?
> >
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Huacai Chen <chenhc@lemote.com>
> > ---
> > arch/mips/kernel/topology.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/mips/kernel/topology.c b/arch/mips/kernel/topology.c
> > index cd3e1f8..08ad637 100644
> > --- a/arch/mips/kernel/topology.c
> > +++ b/arch/mips/kernel/topology.c
> > @@ -20,7 +20,7 @@ static int __init topology_init(void)
> > for_each_present_cpu(i) {
> > struct cpu *c = &per_cpu(cpu_devices, i);
> >
> > - c->hotpluggable = 1;
> > + c->hotpluggable = !!i;
Seems to be the same as what xtensa did, so it's probably not a big
deal.
thanks,
greg k-h
next prev parent reply other threads:[~2020-07-25 6:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-16 10:40 [PATCH V2] MIPS: CPU#0 is not hotpluggable Huacai Chen
2020-07-25 6:37 ` Huacai Chen
2020-07-25 6:49 ` Greg KH [this message]
2020-07-25 6:57 ` Huacai Chen
2020-07-25 7:45 ` Greg KH
2020-07-25 8:29 ` Huacai Chen
2020-07-25 8:57 ` Greg KH
2020-07-26 2:17 ` Jiaxun Yang
2020-07-26 8:25 ` Thomas Bogendoerfer
2020-07-26 11:30 ` Jiaxun Yang
2020-07-26 8:25 ` Thomas Bogendoerfer
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=20200725064923.GA1059787@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=chenhuacai@gmail.com \
--cc=jiaxun.yang@flygoat.com \
--cc=linux-mips@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tsbogend@alpha.franken.de \
--cc=wuzhangjin@gmail.com \
--cc=zhangfx@lemote.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 NNTP newsgroup(s).