Skip to contentSkip to conversation

PATCH: Allow over-ride of smp_found_cfg with kernel cmd-line option.

PATCH Ben Greear 5 participants 11 messages Feb 5, 2009 – Feb 7, 2009

Subsystems (2)
lore
Share & tools
lore

Ben Greear

author
#0 lore raw

Allow user to keep smp_found_cfg set to 1 even if MADT cannot be parsed. This works around funky BIOS on FWA-7304 (VIA CN700 chipset) system, and possibly other systems as well. Without this override, performance drops by around 15% on network throughput tests on this system.

This is based on 2.6.29-rc3

Thanks,
Ben

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
arch/x86/kernel/acpi/boot.c +17 -3
index d37593c..e96bf19 100644
@@ -87,6 +87,7 @@ u8 acpi_sci_flags __initdata;
 int acpi_sci_override_gsi __initdata;
 int acpi_skip_timer_override __initdata;
 int acpi_use_timer_override __initdata;
+int force_smp_found_cfg __initdata;
 
 #ifdef CONFIG_X86_LOCAL_APIC
 static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
@@ -1335,6 +1336,14 @@ static void __init early_acpi_process_madt(void)
 #endif
 }
 
+static int __init parse_force_smp_found_cfg(char *arg)
+{
+	force_smp_found_cfg = 1;
+	return 0;
+}
+early_param("force_smp_found_cfg", parse_force_smp_found_cfg);
+
+
 static void __init acpi_process_madt(void)
 {
 #ifdef CONFIG_X86_LOCAL_APIC
@@ -1381,9 +1390,14 @@ static void __init acpi_process_madt(void)
  		 * Boot with "acpi=off" to use MPS on such a system.
  		 */
 		if (smp_found_config) {
-			printk(KERN_WARNING PREFIX
-				"No APIC-table, disabling MPS\n");
-			smp_found_config = 0;
+			if (force_smp_found_cfg)
+				printk(KERN_WARNING PREFIX
+				       "No APIC-table, wanted to disable MPS, but will not\n  due to force_smp_found_cfg=1\n");
+			else {
+				printk(KERN_WARNING PREFIX
+				       "No APIC-table, disabling MPS.  Use force_smp_found_cfg=1 to override\n");
+				smp_found_config = 0;
+			}
 		}
 	}
 
#1 lore raw
Quoted 9 lines · Ben Greear

Allow user to keep smp_found_cfg set to 1 even if MADT cannot be parsed. This works around funky BIOS on FWA-7304 (VIA CN700 chipset) system, and possibly other systems as well. Without this override, performance drops by around 15% on network throughput tests on this system.

This is based on 2.6.29-rc3

Both patches (smp and tsc) need entries in Documentation/kernel-parameters.txt (if they are accepted/merged).

And thunderbird can be coerced into sending patches inline instead of using attachments... please. Documentation/email-clients.txt might help you.

Thanks,

Signature · 1 line
~Randy
#2 lore raw
In reply to Ben Greear
Quoted 54 lines · Ben Greear

Allow user to keep smp_found_cfg set to 1 even if MADT cannot be parsed. This works around funky BIOS on FWA-7304 (VIA CN700 chipset) system, and possibly other systems as well. Without this override, performance drops by around 15% on network throughput tests on this system.

This is based on 2.6.29-rc3

Thanks,
Ben

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
arch/x86/kernel/acpi/boot.c +10 -3
index d37593c..e96bf19 100644
@@ -87,6 +87,7 @@ u8 acpi_sci_flags __initdata;
 int acpi_sci_override_gsi __initdata;
 int acpi_skip_timer_override __initdata;
 int acpi_use_timer_override __initdata;
+int force_smp_found_cfg __initdata;
 
 #ifdef CONFIG_X86_LOCAL_APIC
 static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
@@ -1335,6 +1336,14 @@ static void __init early_acpi_process_madt(void)
 #endif
 }
 
+static int __init parse_force_smp_found_cfg(char *arg)
+{
+	force_smp_found_cfg = 1;
+	return 0;
+}
+early_param("force_smp_found_cfg", parse_force_smp_found_cfg);
+
+
 static void __init acpi_process_madt(void)
 {
 #ifdef CONFIG_X86_LOCAL_APIC
@@ -1381,9 +1390,14 @@ static void __init acpi_process_madt(void)
  		 * Boot with "acpi=off" to use MPS on such a system.
  		 */
 		if (smp_found_config) {
-			printk(KERN_WARNING PREFIX
-				"No APIC-table, disabling MPS\n");
-			smp_found_config = 0;
+			if (force_smp_found_cfg)

arch/x86/kernel/acpi/boot.c static void __init acpi_process_madt(void) · line 1403

Quoted 10 lines
arch/x86/kernel/acpi/boot.c +7 -0
+				printk(KERN_WARNING PREFIX
+				       "No APIC-table, wanted to disable MPS, but will not\n  due to force_smp_found_cfg=1\n");
+			else {
+				printk(KERN_WARNING PREFIX
+				       "No APIC-table, disabling MPS.  Use force_smp_found_cfg=1 to override\n");
+				smp_found_config = 0;
+			}
 		}
 	}
 

I'd _much_ rather have a warning message printed and have a default, unconditional fallback to mptable parsing in this case.

I.e. same end result just no ugly and inconvenient force_smp_found_cfg.

The mptable works fine in most such cases to enumerate apic details. (as it does in your case, evidently)

And if both the ACPI and the MPTABLE is hosed on a box, it cannot be of much use on other OSs either, right?

So please do a patch that removes the 'smp_found_config' and which changes the warning message to warn about no ACPI table in the MADT table. Ok?

Ingo

author
#3 lore raw
Quoted 9 lines · Ingo Molnar

I'd _much_ rather have a warning message printed and have a default, unconditional fallback to mptable parsing in this case.

I.e. same end result just no ugly and inconvenient force_smp_found_cfg.

The mptable works fine in most such cases to enumerate apic details. (as it does in your case, evidently)

And if both the ACPI and the MPTABLE is hosed on a box, it cannot be of much use on other OSs either, right?

So please do a patch that removes the 'smp_found_config' and which changes the warning message to warn about no ACPI table in the MADT table. Ok?

That is fine with me, but I know next to zero about the deep logic of this code. I'd be worried that Len put in the change to fix something more critical than my problem on my particular board.

If no one argues otherwise, I'll get a patch together & tested this evening.

Thanks,
Ben

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
author
#4 lore raw

Re: PATCH: (v2) Allow over-ride of smp_found_cfg with kernel cmd-line option.

In reply to Ingo Molnar
Quoted 10 lines · Ingo Molnar
Quoted 5 lines · Ben Greear

Allow user to keep smp_found_cfg set to 1 even if MADT cannot be parsed. This works around funky BIOS on FWA-7304 (VIA CN700 chipset) system, and possibly other systems as well. Without this override, performance drops by around 15% on network throughput tests on this system.

I'd _much_ rather have a warning message printed and have a default, unconditional fallback to mptable parsing in this case.

Quoted 7 lines

I.e. same end result just no ugly and inconvenient force_smp_found_cfg.

The mptable works fine in most such cases to enumerate apic details. (as it does in your case, evidently)

And if both the ACPI and the MPTABLE is hosed on a box, it cannot be of much use on other OSs either, right?

So please do a patch that removes the 'smp_found_config' and which changes the warning message to warn about no ACPI table in the MADT table. Ok?

An updated patch is attached. It's also inline below, but I'm sure the inline version is white-space corrupted.

Do not disable mptable parsing just because there is no ACPI table in the MADT table. This effectively backs out changeset 7b37b5fd9ba32c0c5afc3537eed7e7466f2173e2

Thanks,
Ben

arch/x86/kernel/acpi/boot.c +6 -4
index d37593c..74a50b6 100644
@@ -1379,12 +1379,14 @@ static void __init acpi_process_madt(void)
  		 * ACPI found no MADT, and so ACPI wants UP PIC mode.
  		 * In the event an MPS table was found, forget it.
  		 * Boot with "acpi=off" to use MPS on such a system.
+		 *
+		 * NOTE:  This assumption seems wrong in at least some cases, perhaps
+		 *  when ACPI is off in the BIOS.  Changing to a warning without
+		 *  setting smp_found_config to zero.
  		 */
-		if (smp_found_config) {
+		if (smp_found_config)
 			printk(KERN_WARNING PREFIX
-				"No APIC-table, disabling MPS\n");
-			smp_found_config = 0;
-		}
+				"WARNING: No ACPI-table found in the MADT\n");
 	}
 
 	/*
Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
arch/x86/kernel/acpi/boot.c +6 -4
index d37593c..74a50b6 100644
@@ -1379,12 +1379,14 @@ static void __init acpi_process_madt(void)
  		 * ACPI found no MADT, and so ACPI wants UP PIC mode.
  		 * In the event an MPS table was found, forget it.
  		 * Boot with "acpi=off" to use MPS on such a system.
+		 *
+		 * NOTE:  This assumption seems wrong in at least some cases, perhaps
+		 *  when ACPI is off in the BIOS.  Changing to a warning without
+		 *  setting smp_found_config to zero.
  		 */
-		if (smp_found_config) {
+		if (smp_found_config)
 			printk(KERN_WARNING PREFIX
-				"No APIC-table, disabling MPS\n");
-			smp_found_config = 0;
-		}
+				"WARNING: No ACPI-table found in the MADT\n");
 	}
 
 	/*
#5 lore raw

Re: PATCH: (v2) Allow over-ride of smp_found_cfg with kernel cmd-line option.

Quoted 48 lines · Ben Greear
Quoted 16 lines · Ingo Molnar
Quoted 5 lines · Ben Greear

Allow user to keep smp_found_cfg set to 1 even if MADT cannot be parsed. This works around funky BIOS on FWA-7304 (VIA CN700 chipset) system, and possibly other systems as well. Without this override, performance drops by around 15% on network throughput tests on this system.

I'd _much_ rather have a warning message printed and have a default, unconditional fallback to mptable parsing in this case.

I.e. same end result just no ugly and inconvenient force_smp_found_cfg.

The mptable works fine in most such cases to enumerate apic details. (as it does in your case, evidently)

Quoted 6 lines

And if both the ACPI and the MPTABLE is hosed on a box, it cannot be of much use on other OSs either, right?

So please do a patch that removes the 'smp_found_config' and which changes the warning message to warn about no ACPI table in the MADT table. Ok?

An updated patch is attached. It's also inline below, but I'm sure the inline version is white-space corrupted.

Do not disable mptable parsing just because there is no ACPI table in the MADT table. This effectively backs out changeset 7b37b5fd9ba32c0c5afc3537eed7e7466f2173e2

Thanks,
Ben

arch/x86/kernel/acpi/boot.c +2 -0
index d37593c..74a50b6 100644
@@ -1379,12 +1379,14 @@ static void __init acpi_process_madt(void)
           * ACPI found no MADT, and so ACPI wants UP PIC mode.
           * In the event an MPS table was found, forget it.
           * Boot with "acpi=off" to use MPS on such a system.
+         *
+         * NOTE:  This assumption seems wrong in at least some cases,

perhaps

arch/x86/kernel/acpi/boot.c static void __init acpi_process_madt(void) · line 1389

Quoted 10 lines
arch/x86/kernel/acpi/boot.c +4 -4
+         *  when ACPI is off in the BIOS.  Changing to a warning without
+         *  setting smp_found_config to zero.
           */
-        if (smp_found_config) {
+        if (smp_found_config)
             printk(KERN_WARNING PREFIX
-                "No APIC-table, disabling MPS\n");
-            smp_found_config = 0;
-        }
+                "WARNING: No ACPI-table found in the MADT\n");

APIC table

Quoted 6 lines
     }

     /*
Signature · 1 line
~Randy
#9 lore raw
In reply to Ben Greear
Quoted 5 lines · Ben Greear

Allow user to keep smp_found_cfg set to 1 even if MADT cannot be parsed. This works around funky BIOS on FWA-7304 (VIA CN700 chipset) system, and possibly other systems as well. Without this override, performance drops by around 15% on network throughput tests on this system.

The question is, _why_ does network performance drop?

Do you have a before/after pair of /proc/interrupts output perhaps? Does the layout of IRQs change?

The system is not SMP - so only something about UP-IOAPIC can be helpful to performance here - or some unknown effect.

Ingo

#6 lore raw

Re: PATCH: (v2) Allow over-ride of smp_found_cfg with kernel cmd-line option.

In reply to Randy Dunlap
Quoted 51 lines · Randy Dunlap
Quoted 50 lines · Ben Greear
Quoted 15 lines · Ingo Molnar
Quoted 5 lines · Ben Greear

Allow user to keep smp_found_cfg set to 1 even if MADT cannot be parsed. This works around funky BIOS on FWA-7304 (VIA CN700 chipset) system, and possibly other systems as well. Without this override, performance drops by around 15% on network throughput tests on this system.

I'd _much_ rather have a warning message printed and have a default, unconditional fallback to mptable parsing in this case.

I.e. same end result just no ugly and inconvenient force_smp_found_cfg.

The mptable works fine in most such cases to enumerate apic details. (as it does in your case, evidently)

Quoted 6 lines

And if both the ACPI and the MPTABLE is hosed on a box, it cannot be of much use on other OSs either, right?

So please do a patch that removes the 'smp_found_config' and which changes the warning message to warn about no ACPI table in the MADT table. Ok?

An updated patch is attached. It's also inline below, but I'm sure the inline version is white-space corrupted.

Do not disable mptable parsing just because there is no ACPI table in the MADT table. This effectively backs out changeset 7b37b5fd9ba32c0c5afc3537eed7e7466f2173e2

Thanks,
Ben

arch/x86/kernel/acpi/boot.c +2 -0
index d37593c..74a50b6 100644
@@ -1379,12 +1379,14 @@ static void __init acpi_process_madt(void)
           * ACPI found no MADT, and so ACPI wants UP PIC mode.
           * In the event an MPS table was found, forget it.
           * Boot with "acpi=off" to use MPS on such a system.
+         *
+         * NOTE:  This assumption seems wrong in at least some cases,

perhaps

arch/x86/kernel/acpi/boot.c +2 -1
+         *  when ACPI is off in the BIOS.  Changing to a warning without
+         *  setting smp_found_config to zero.
           */
-        if (smp_found_config) {
Quoted 9 lines

arch/x86/kernel/acpi/boot.c static void __init acpi_process_madt(void) · line 1389

Quoted 6 lines
arch/x86/kernel/acpi/boot.c +2 -3
+        if (smp_found_config)
             printk(KERN_WARNING PREFIX
-                "No APIC-table, disabling MPS\n");
-            smp_found_config = 0;
-        }
+                "WARNING: No ACPI-table found in the MADT\n");

APIC table

APIC-table == MADT

could just use

WARNING: No APIC-table found

YH

author
#7 lore raw

Re: PATCH: (v3) Allow over-ride of smp_found_cfg with kernel cmd-line option.

Quoted 9 lines · Yinghai Lu
Quoted 3 lines
Quoted 1 line

+ "WARNING: No ACPI-table found in the MADT\n");

APIC table

APIC-table == MADT

could just use

WARNING: No APIC-table found

Ok, here's another attempt. NOTE: With another patch that Len sent me, this work-around seems no longer required for *my* system. This patch may still help others, however...

An updated patch is attached. It's also inline below, but I'm sure the inline version is white-space corrupted.

Do not disable mptable parsing just because there is no ACPI table in the MADT table. This effectively backs out changeset 7b37b5fd9ba32c0c5afc3537eed7e7466f2173e2

arch/x86/kernel/acpi/boot.c +6 -4
index d37593c..6940fb2 100644
@@ -1379,12 +1379,14 @@ static void __init acpi_process_madt(void)
  		 * ACPI found no MADT, and so ACPI wants UP PIC mode.
  		 * In the event an MPS table was found, forget it.
  		 * Boot with "acpi=off" to use MPS on such a system.
+		 *
+		 * NOTE:  This assumption seems wrong in at least some cases, perhaps
+		 *  when ACPI is off in the BIOS.  Changing to a warning without
+		 *  setting smp_found_config to zero.
  		 */
-		if (smp_found_config) {
+		if (smp_found_config)
 			printk(KERN_WARNING PREFIX
-				"No APIC-table, disabling MPS\n");
-			smp_found_config = 0;
-		}
+			       "WARNING: No APIC-table found.\n");
 	}
 
 	/*
Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
arch/x86/kernel/acpi/boot.c +6 -4
index d37593c..6940fb2 100644
@@ -1379,12 +1379,14 @@ static void __init acpi_process_madt(void)
  		 * ACPI found no MADT, and so ACPI wants UP PIC mode.
  		 * In the event an MPS table was found, forget it.
  		 * Boot with "acpi=off" to use MPS on such a system.
+		 *
+		 * NOTE:  This assumption seems wrong in at least some cases, perhaps
+		 *  when ACPI is off in the BIOS.  Changing to a warning without
+		 *  setting smp_found_config to zero.
  		 */
-		if (smp_found_config) {
+		if (smp_found_config)
 			printk(KERN_WARNING PREFIX
-				"No APIC-table, disabling MPS\n");
-			smp_found_config = 0;
-		}
+			       "WARNING: No APIC-table found.\n");
 	}
 
 	/*
reviewer
#10 lore raw
In reply to Ingo Molnar
Quoted 10 lines
Quoted 2 lines

Without this override, performance drops by around 15% on network throughput tests on this system.

The question is, _why_ does network performance drop?

Do you have a before/after pair of /proc/interrupts output perhaps? Does the layout of IRQs change?

The system is not SMP - so only something about UP-IOAPIC can be helpful to performance here - or some unknown effect.

I presume it is IOAPIC (good) vs PIC (bad), for the
patch that provoked this regression was one that caused
the MPS table to be disabled. (the problem with that patch was that it was effective not just in ACPI mode, but in acpi=off mode)

The other un-answered question is why the system under test has ACPI disabled in the BIOS when it did not ship that way from the manufacturer.

cheers,
-Len
Intel Open Source Technology Center

reviewer
#8 lore raw

Re: PATCH: (v3) Allow over-ride of smp_found_cfg with kernel cmd-line option.

In reply to Ben Greear
Quoted 5 lines

Ok, here's another attempt. NOTE: With another patch that Len sent me, this work-around seems no longer required for *my* system. This patch may still help others, however...

Ben, your system is fixed by my patch, which makes this code not run.
http://lkml.org/lkml/2009/2/6/354

I do not want to apply the patch in this thread, because I know of one system it will hurt, and zero systems it will help.

thanks,
-Len
Len Brown, Intel Open Source Technology Center