From: Randy Dunlap <randy.dunlap@oracle.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
"Luck, Tony" <tony.luck@intel.com>,
"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Andrew Morton <akpm@linux-foundation.org>,
Wu Fengguang <fengguang.wu@intel.com>,
Bjorn Helgaas <bjorn.helgaas@hp.com>
Subject: Re: [GIT PULL] x86/apic changes for v2.6.38
Date: Thu, 6 Jan 2011 17:21:54 -0800 [thread overview]
Message-ID: <20110106172154.edee5c66.randy.dunlap@oracle.com> (raw)
In-Reply-To: <AANLkTimJMMC=LoD4igGCMdcFaBS9EpHVHh_x5=91_bbE@mail.gmail.com>
On Thu, 6 Jan 2011 16:17:10 -0800 Yinghai Lu wrote:
> On Thu, Jan 6, 2011 at 3:53 PM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> > On Thu, Jan 6, 2011 at 3:48 PM, Luck, Tony <tony.luck@intel.com> wrote:
> >> Untested on X86. Builds and boots on ia64 (both normally and with
> >> maxcpus=8 to limit the number of cpus).
> >>
> >> Signed-off-by: Tony Luck <tony.luck@intel.com>
> >
> > Looks much better to me, and gets rid of that silly #ifdef that I reacted to.
> >
> > But no hurry, this looks low-priority. So let's make this go through
> > the x86 tree and get merged later, after it has passed whatever normal
> > tests that the -tip tree goes through. Ok?
>
> yes. x86 is safe. We have apicid_to_node[] array, and already check
> apic id with MAX_LOCAL_APIC
> in x86 version acpi_numa_processor_affinity_init().
>
> looks ia64 is using struct array with cpu idx for mapping
>
> node_cpuid[srat_num_cpus].phys_id =
> (pa->apic_id << 8) | (pa->local_sapic_eid);
> /* nid should be overridden as logical node id later */
> node_cpuid[srat_num_cpus].nid = pxm;
> cpu_set(srat_num_cpus, early_cpu_possible_map);
> srat_num_cpus++;
>
> but it does not check the boundary of that array...
>
> struct node_cpuid_s node_cpuid[NR_CPUS]..
>
> so if some one try to boot kernel with small NR_CPUS on bigger IA64
> system, could get some variables node_cpuid[]...
>
> Assume Tony will have another patch for IA64 to check that before
> apply this patch.
>
> sth like
>
> Index: linux-2.6/arch/ia64/kernel/acpi.c
> ===================================================================
> --- linux-2.6.orig/arch/ia64/kernel/acpi.c
> +++ linux-2.6/arch/ia64/kernel/acpi.c
> @@ -477,6 +479,11 @@ acpi_numa_processor_affinity_init(struct
> if (!(pa->flags & ACPI_SRAT_CPU_ENABLED))
> return;
>
> + if (srat_num_cpus >= NR_CPUS) {
> + printk(KERN_WARNING "NR_CPUS (%d) is too small, not all cpus used.
> %d\n", NR_CPUS);
CPUs used.
Don't need %d 2 times.
> + return;
> + }
> +
> pxm = get_processor_proximity_domain(pa);
>
> /* record this node in proximity bitmap */
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
next prev parent reply other threads:[~2011-01-07 1:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-06 9:44 [GIT PULL] x86/apic changes for v2.6.38 Ingo Molnar
2011-01-06 18:55 ` Linus Torvalds
2011-01-06 19:22 ` H. Peter Anvin
2011-01-06 19:57 ` Tony Luck
2011-01-06 22:27 ` Tony Luck
2011-01-06 23:48 ` Luck, Tony
2011-01-06 23:53 ` Linus Torvalds
2011-01-07 0:17 ` Yinghai Lu
2011-01-07 0:32 ` Tony Luck
2011-01-07 1:21 ` Randy Dunlap [this message]
2011-01-07 1:48 ` Yinghai Lu
2011-01-11 18:36 ` Tony Luck
2011-01-12 8:28 ` Ingo Molnar
2011-01-12 8:50 ` Yinghai Lu
2011-01-12 11:36 ` [tip:x86/urgent] x86, ia64, acpi: Clean up x86-ism in drivers/acpi/numa.c tip-bot for Tony Luck
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=20110106172154.edee5c66.randy.dunlap@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=bjorn.helgaas@hp.com \
--cc=fengguang.wu@intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=torvalds@linux-foundation.org \
--cc=yinghai@kernel.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