From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Huacai Chen <chenhc@lemote.com>, Ralf Baechle <ralf@linux-mips.org>
Cc: 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>
Subject: Re: [PATCH 1/9] MIPS: Support hard limit of cpu count (nr_cpu_ids)
Date: Fri, 04 Apr 2014 15:48:19 +0400 [thread overview]
Message-ID: <533E9C03.9060808@cogentembedded.com> (raw)
In-Reply-To: <1396599104-24370-2-git-send-email-chenhc@lemote.com>
Hello.
On 04-04-2014 12:11, 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>
> ---
> arch/mips/kernel/setup.c | 18 ++++++++++++++++++
> 1 files changed, 18 insertions(+), 0 deletions(-)
> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
> index a842154..7ffda01 100644
> --- a/arch/mips/kernel/setup.c
> +++ b/arch/mips/kernel/setup.c
> @@ -729,6 +729,23 @@ static void __init resource_init(void)
> }
> }
>
> +static void __init prefill_possible_map(void)
> +{
> +#ifdef CONFIG_SMP
> + 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;
> +#endif
> +}
> +
#ifdef's in the function body are ugly. Instead I'm suggesting:
#ifdef CONFIG_SMP
static void __init prefill_possible_map(void)
{
[...]
}
#else
static inline void prefill_possible_map(void) {}
#endif
WBR, Sergei
next prev parent reply other threads:[~2014-04-04 11:48 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-04 8:11 [PATCH 00/12] MIPS: Loongson-3: Add NUMA and Loongson-3B support Huacai Chen
2014-04-04 8:11 ` [PATCH 1/9] MIPS: Support hard limit of cpu count (nr_cpu_ids) Huacai Chen
2014-04-04 11:48 ` Sergei Shtylyov [this message]
2014-04-04 8:11 ` [PATCH 2/9] MIPS: Support CPU topology files in sysfs Huacai Chen
2014-04-04 8:11 ` [PATCH 3/9] MIPS: Loongson: Modify ChipConfig register definition Huacai Chen
2014-04-04 8:11 ` [PATCH 4/9] MIPS: Add NUMA support for Loongson-3 Huacai Chen
2014-04-04 8:11 ` [PATCH 5/9] MIPS: Add numa api support Huacai Chen
2014-04-04 16:45 ` David Daney
2014-04-05 0:54 ` "陈华才"
2014-04-10 10:47 ` Huacai Chen
2014-04-11 8:21 ` Huacai Chen
2014-04-11 12:15 ` Alex Smith
2014-04-11 13:38 ` Huacai Chen
2014-04-11 13:57 ` Alex Smith
2014-04-04 8:11 ` [PATCH 6/9] MIPS: Add Loongson-3B support Huacai Chen
2014-04-04 8:11 ` [PATCH 7/9] MIPS: Loongson: Make CPU name more clear Huacai Chen
2014-04-04 8:48 ` Aaro Koskinen
2014-04-05 19:10 ` Matt Turner
2014-04-04 8:11 ` [PATCH 8/9] MIPS: Loongson-3: Enable the COP2 usage Huacai Chen
2014-04-05 18:51 ` Matt Turner
2014-04-06 2:06 ` "陈华才"
2014-04-09 8:23 ` chengxiuzhi
2014-04-04 8:11 ` [PATCH 9/9] 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=533E9C03.9060808@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=Steven.Hill@imgtec.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox