All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] [arch-x86] Allow SRAT integrity check to be skipped
@ 2010-09-01 22:59 Peter P Waskiewicz Jr
  2010-09-02 11:33 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Peter P Waskiewicz Jr @ 2010-09-01 22:59 UTC (permalink / raw)
  To: tglx, mingo, hpa, x86; +Cc: linux-kernel, andi, netdev, peter.p.waskiewicz.jr

On certain BIOSes, SRAT enumeration isn't exported correctly.
This leads to NUMA node enumeration failure, and causes the kernel
to fall back onto a single node treated as flat memory.  This
can happen on large, multi-socket systems (4 or more sockets), and
becomes problematic for performance.

This patch adds a boot parameter to allow a kernel to be booted
with the option to skip the SRAT check.  There are BIOSes in
production that have these failures, so this will allow people
in the field to work around these BIOS issues.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
---

 Documentation/x86/x86_64/boot-options.txt |    4 ++++
 arch/x86/mm/srat_64.c                     |   20 +++++++++++++++++---
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/Documentation/x86/x86_64/boot-options.txt b/Documentation/x86/x86_64/boot-options.txt
index 7fbbaf8..7863d9c 100644
--- a/Documentation/x86/x86_64/boot-options.txt
+++ b/Documentation/x86/x86_64/boot-options.txt
@@ -316,3 +316,7 @@ Miscellaneous
 		Do not use GB pages for kernel direct mappings.
 	gbpages
 		Use GB pages for kernel direct mappings.
+ 	sratbypassbios
+		If specified, will skip an SRAT check for PXM coverage
+		from BIOS enumeration.  Only to be used on systems with
+		buggy BIOSes that munge the SRAT enumeration.
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c
index f9897f7..9fa2e32 100644
--- a/arch/x86/mm/srat_64.c
+++ b/arch/x86/mm/srat_64.c
@@ -351,6 +351,15 @@ int __init acpi_get_nodes(struct bootnode *physnodes)
 	return ret;
 }
 
+static int srat_bypass_bios;
+
+static int __init srat_bypass_bios_setup(char *str)
+{
+        srat_bypass_bios = 1;
+        return 0;
+}
+early_param("sratbypassbios", srat_bypass_bios_setup);
+
 /* Use the information discovered above to actually set up the nodes. */
 int __init acpi_scan_nodes(unsigned long start, unsigned long end)
 {
@@ -425,9 +434,14 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
 						nodes[i].end >> PAGE_SHIFT);
 	/* for out of order entries in SRAT */
 	sort_node_map();
-	if (!nodes_cover_memory(nodes)) {
-		bad_srat();
-		return -1;
+	if (!srat_bypass_bios) {
+		if (!nodes_cover_memory(nodes)) {
+			bad_srat();
+			return -1;
+		}
+	} else {
+		printk(KERN_INFO
+		           "SRAT: Bypassing NUMA sanity check...bad BIOS...\n");
 	}
 
 	/* Account for nodes with cpus and no memory */


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] [arch-x86] Allow SRAT integrity check to be skipped
  2010-09-01 22:59 [PATCH v2] [arch-x86] Allow SRAT integrity check to be skipped Peter P Waskiewicz Jr
@ 2010-09-02 11:33 ` Johannes Berg
  2010-09-02 19:39   ` Peter P Waskiewicz Jr
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2010-09-02 11:33 UTC (permalink / raw)
  To: Peter P Waskiewicz Jr; +Cc: tglx, mingo, hpa, x86, linux-kernel, andi, netdev

On Wed, 2010-09-01 at 15:59 -0700, Peter P Waskiewicz Jr wrote:

> +static int srat_bypass_bios;
> +
> +static int __init srat_bypass_bios_setup(char *str)
> +{
> +        srat_bypass_bios = 1;
> +        return 0;
> +}
> +early_param("sratbypassbios", srat_bypass_bios_setup);
> +
>  /* Use the information discovered above to actually set up the nodes. */
>  int __init acpi_scan_nodes(unsigned long start, unsigned long end)
>  {

I wonder, since all the things using the variable are __init, could it
be as well? Just curious really.

johannes


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] [arch-x86] Allow SRAT integrity check to be skipped
  2010-09-02 11:33 ` Johannes Berg
@ 2010-09-02 19:39   ` Peter P Waskiewicz Jr
  0 siblings, 0 replies; 3+ messages in thread
From: Peter P Waskiewicz Jr @ 2010-09-02 19:39 UTC (permalink / raw)
  To: Johannes Berg; +Cc: tglx, mingo, hpa, x86, linux-kernel, andi, netdev

On Thu, 2010-09-02 at 04:33 -0700, Johannes Berg wrote:
> On Wed, 2010-09-01 at 15:59 -0700, Peter P Waskiewicz Jr wrote:
> 
> > +static int srat_bypass_bios;
> > +
> > +static int __init srat_bypass_bios_setup(char *str)
> > +{
> > +        srat_bypass_bios = 1;
> > +        return 0;
> > +}
> > +early_param("sratbypassbios", srat_bypass_bios_setup);
> > +
> >  /* Use the information discovered above to actually set up the nodes. */
> >  int __init acpi_scan_nodes(unsigned long start, unsigned long end)
> >  {
> 
> I wonder, since all the things using the variable are __init, could it
> be as well? Just curious really.

That is a good question.  It makes sense to me, but I just followed what
other boot-time options did, which are not marked __init.  I'll defer to
anyone else on the list who is better-equipped to answer that.

-PJ


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-02 19:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-01 22:59 [PATCH v2] [arch-x86] Allow SRAT integrity check to be skipped Peter P Waskiewicz Jr
2010-09-02 11:33 ` Johannes Berg
2010-09-02 19:39   ` Peter P Waskiewicz Jr

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.