From: msalter@redhat.com (Mark Salter)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: fix handling of nr_cpus
Date: Thu, 13 Oct 2011 08:17:47 -0400 [thread overview]
Message-ID: <1318508268.2300.67.camel@deneb.redhat.com> (raw)
In-Reply-To: <20111012172628.GC21648@n2100.arm.linux.org.uk>
On Wed, 2011-10-12 at 18:26 +0100, Russell King - ARM Linux wrote:
> On Tue, Oct 11, 2011 at 09:31:04AM -0400, Mark Salter wrote:
> > The current code duplicates the setup of the cpu_possible bitmap in the
> > platform smp_init_cpus() function. Unfortunately, all of those places
> > have the same bug where the nr_cpus kernel parameter is ignored. This patch
> > consolidates the duplicated code in one place and fixes it to honor the
> > nr_cpus parameter. This is accomplished by having smp_init_cpus() return
> > the platform specific number of cores so that the caller (setup_arch) can
> > set up the cpu_possible bitmap correctly for all platforms.
>
> Who says every platform we're going to see will always have CPUs 0..N ?
> It's entirely possible that someone might want to have CPUs 0, 2, 3 as
> possible CPUs but omit CPU1 for platform reasons.
Good point. We could do that by not setting the cpu_present bit for the
CPU we want to omit. Or we could leave the current platform cpu_possible
setup as-is and add something like:
for (i = nr_cpu_ids; i < NR_CPUS; i++)
set_cpu_possible(i, false);
to setup_arch after the call to smp_init_cpus.
--Mark
next prev parent reply other threads:[~2011-10-13 12:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-11 13:31 [PATCH] arm: fix handling of nr_cpus Mark Salter
2011-10-12 17:26 ` Russell King - ARM Linux
2011-10-13 12:17 ` Mark Salter [this message]
2011-10-13 15:10 ` Russell King - ARM Linux
2011-10-18 13:16 ` Mark Salter
2011-10-20 11:25 ` Russell King - ARM Linux
2011-10-20 13:02 ` Mark Salter
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=1318508268.2300.67.camel@deneb.redhat.com \
--to=msalter@redhat.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;
as well as URLs for NNTP newsgroup(s).