From: Andreas Herrmann <herrmann.der.user@googlemail.com>
To: Huacai Chen <chenhc@lemote.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
John Crispin <john@phrozen.org>,
"Steven J. Hill" <Steven.Hill@imgtec.com>,
Aurelien Jarno <aurelien@aurel32.net>,
linux-mips@linux-mips.org, Fuxin Zhang <zhangfx@lemote.com>,
Zhangjin Wu <wuzhangjin@gmail.com>,
Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
Subject: Re: [PATCH V2 1/8] MIPS: Support hard limit of cpu count (nr_cpu_ids)
Date: Mon, 14 Apr 2014 16:48:18 +0200 [thread overview]
Message-ID: <20140414144818.GA10997@alberich> (raw)
In-Reply-To: <1397348662-22502-2-git-send-email-chenhc@lemote.com>
On Sun, Apr 13, 2014 at 08:24:15AM +0800, Huacai Chen wrote:
> On MIPS currently, only the soft limit of cpu count (maxcpus) has its
> effect, this patch enable the hard limit (nr_cpus) as well. Processor
> cores which greater than maxcpus and less than nr_cpus can be taken up
> via cpu hotplug. The code is borrowed from X86.
>
> Signed-off-by: Huacai Chen <chenhc@lemote.com>
Reviewed-by: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
W/o this patch nr_cpus had no effect and all CPUs present on a chip
(even if greater than or equal to nr_cpus) could be taken online with
CPU hotplug. W/o the patch nr_cpus took effect.
Only nitpick: I find the name of the function somehow misleading.
I think it's rather a kind of fixup (to factor in nr_cpus) after
platform smp_setup might have already "prefilled"
cpu_possible_mask. At least in case of cavium-octeon this is the case.
Thanks,
Andreas
> ---
> arch/mips/kernel/setup.c | 20 ++++++++++++++++++++
> 1 files changed, 20 insertions(+), 0 deletions(-)
>
> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
> index a842154..2f01201 100644
> --- a/arch/mips/kernel/setup.c
> +++ b/arch/mips/kernel/setup.c
> @@ -729,6 +729,25 @@ static void __init resource_init(void)
> }
> }
>
> +#ifdef CONFIG_SMP
> +static void __init prefill_possible_map(void)
> +{
> + int i, possible = num_possible_cpus();
> +
> + if (possible > nr_cpu_ids)
> + possible = nr_cpu_ids;
> +
> + for (i = 0; i < possible; i++)
> + set_cpu_possible(i, true);
> + for (; i < NR_CPUS; i++)
> + set_cpu_possible(i, false);
> +
> + nr_cpu_ids = possible;
> +}
> +#else
> +static inline void prefill_possible_map(void) {}
> +#endif
> +
> void __init setup_arch(char **cmdline_p)
> {
> cpu_probe();
> @@ -752,6 +771,7 @@ void __init setup_arch(char **cmdline_p)
>
> resource_init();
> plat_smp_setup();
> + prefill_possible_map();
>
> cpu_cache_init();
> }
> --
> 1.7.7.3
>
>
next prev parent reply other threads:[~2014-04-14 14:48 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-13 0:24 [PATCH V2 0/8] MIPS: Loongson-3: Add NUMA and Loongson-3B support Huacai Chen
2014-04-13 0:24 ` [PATCH V2 1/8] MIPS: Support hard limit of cpu count (nr_cpu_ids) Huacai Chen
2014-04-14 14:48 ` Andreas Herrmann [this message]
2014-04-13 0:24 ` [PATCH V2 2/8] MIPS: Support CPU topology files in sysfs Huacai Chen
2014-04-14 15:04 ` Andreas Herrmann
2014-04-13 0:24 ` [PATCH V2 3/8] MIPS: Loongson: Modify ChipConfig register definition Huacai Chen
2014-04-13 0:24 ` [PATCH V2 4/8] MIPS: Add NUMA support for Loongson-3 Huacai Chen
2014-06-03 22:47 ` Ralf Baechle
2014-06-03 23:47 ` David Daney
2014-06-04 6:46 ` Ralf Baechle
2014-06-04 17:22 ` David Daney
2014-06-05 9:15 ` Huacai Chen
2014-04-13 0:24 ` [PATCH V2 5/8] MIPS: Add numa api support Huacai Chen
2014-04-13 0:24 ` [PATCH V2 6/8] MIPS: Add Loongson-3B support Huacai Chen
2014-04-13 0:24 ` [PATCH V2 7/8] MIPS: Loongson-3: Enable the COP2 usage Huacai Chen
2014-04-13 0:24 ` [PATCH V2 8/8] MIPS: Loongson: Rename CONFIG_LEMOTE_MACH3A to CONFIG_LOONGSON_MACH3X Huacai Chen
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=20140414144818.GA10997@alberich \
--to=herrmann.der.user@googlemail.com \
--cc=Steven.Hill@imgtec.com \
--cc=andreas.herrmann@caviumnetworks.com \
--cc=aurelien@aurel32.net \
--cc=chenhc@lemote.com \
--cc=john@phrozen.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--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 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.