From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4] ARM: vexpress: add support for multiple core tiles
Date: Tue, 7 Dec 2010 16:18:07 -0000 [thread overview]
Message-ID: <007301cb962a$55de83b0$019b8b10$@deacon@arm.com> (raw)
In-Reply-To: <20101207151310.GB23589@n2100.arm.linux.org.uk>
Hi Russell,
> > - /* sanity check */
> > - if (ncores > NR_CPUS) {
> > + ct_desc->init_cpu_map();
> > + if (!num_possible_cpus()) {
> > printk(KERN_WARNING
> > - "vexpress: no. of cores (%d) greater than configured "
> > - "maximum of %d - clipping\n",
> > - ncores, NR_CPUS);
> > - ncores = NR_CPUS;
> > + "vexpress: no possible CPUs declared, forcing logical "
> > + "CPU 0\n");
> > + set_cpu_possible(0, true);
>
> Hmm. The right check is whether the current CPU number is set in the
> possible map - if it's clear, then that's certainly a bug.
>
> However, this will never happen, unless you do something really silly
> in ->init_cpu_map() such as clearing all possible CPUs, or setting
> them false. See boot_cpu_init() in init/main.c.
>
> So I don't think we need this check (and I think it should be in the
> platform code.)
Ok, my initial thought was to lose the check as well. This means
that all we do in smp_init_cpus for vexpress is invoke
ct_desc->init_cpu_map().
> Alteratively, we could do this in the generic SMP code:
>
> if (num_possible_cpus() > NR_CPUS) {
> unsigned int nr = 0, cpu;
>
> pr_warning("SMP: number of CPUs greater than configured %u, disabling CPU",
> NR_CPUS);
>
> for_each_possible_cpu(cpu) {
> if (nr >= NR_CPUS) {
> cpu_set_possible(cpu, false);
> pr_cont(" %u", cpu);
> }
> nr++;
> }
> pr_cont("\n");
> }
Can num_possible_cpus() be > NR_CPUS? I think the bitmap used to calculate
the former is limited by the latter anyway.
Thanks,
Will
prev parent reply other threads:[~2010-12-07 16:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-07 14:43 [PATCH v4] ARM: vexpress: add support for multiple core tiles Will Deacon
2010-12-07 15:13 ` Russell King - ARM Linux
2010-12-07 16:18 ` Will Deacon [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='007301cb962a$55de83b0$019b8b10$@deacon@arm.com' \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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