Skip to contentSkip to conversation

Minimise printk spew from per-vendor init code.

X86 NAK Dave Jones 3 participants 7 messages Nov 13, 2009 – Nov 14, 2009 x86

lore
Share & tools
lore

Dave Jones

author
#0 lore raw

In the default case where the kernel supports all CPU vendors, we currently print out a bunch of not useful messages on every system.

32bit:
KERNEL supported cpus:
Intel GenuineIntel
AMD AuthenticAMD
NSC Geode by NSC
Cyrix CyrixInstead
Centaur CentaurHauls
Transmeta GenuineTMx86
Transmeta TransmetaCPU
UMC UMC UMC UMC

64bit:
KERNEL supported cpus:
Intel GenuineIntel
AMD AuthenticAMD
Centaur CentaurHauls

Given that "what CPUs does the kernel support" isn't useful for the "support everything" case, we can suppress these printk's.

arch/x86/kernel/cpu/common.c +2 -1
index cc25c2b..617a29f 100644
@@ -656,6 +656,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
 
 void __init early_cpu_init(void)
 {
+#ifdef PROCESSOR_SELECT
 	const struct cpu_dev *const *cdev;
 	int count = 0;
 
@@ -676,7 +677,7 @@ void __init early_cpu_init(void)
 				cpudev->c_ident[j]);
 		}
 	}
-
+#endif
 	early_identify_cpu(&boot_cpu_data);
 }
 
#1 lore raw

[tip:x86/debug] x86: Minimise printk spew from per-vendor init code

Commit-ID:  0388423dba2217b4e5b6c61690b0506d13b25a49
Gitweb:     http://git.kernel.org/tip/0388423dba2217b4e5b6c61690b0506d13b25a49
Author:     Dave Jones <[email protected]>
AuthorDate: Fri, 13 Nov 2009 15:30:00 -0500
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sat, 14 Nov 2009 01:18:05 +0100

x86: Minimise printk spew from per-vendor init code

In the default case where the kernel supports all CPU vendors, we currently print out a bunch of not useful messages on every system.

32-bit:
KERNEL supported cpus:
Intel GenuineIntel
AMD AuthenticAMD
NSC Geode by NSC
Cyrix CyrixInstead
Centaur CentaurHauls
Transmeta GenuineTMx86
Transmeta TransmetaCPU
UMC UMC UMC UMC

64-bit:
KERNEL supported cpus:
Intel GenuineIntel
AMD AuthenticAMD
Centaur CentaurHauls

Given that "what CPUs does the kernel support" isn't useful for the "support everything" case, we can suppress these printk's.

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/cpu/common.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/x86/kernel/cpu/common.c +2 -1
index cc25c2b..617a29f 100644
@@ -656,6 +656,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
 
 void __init early_cpu_init(void)
 {
+#ifdef PROCESSOR_SELECT
 	const struct cpu_dev *const *cdev;
 	int count = 0;
 
@@ -676,7 +677,7 @@ void __init early_cpu_init(void)
 				cpudev->c_ident[j]);
 		}
 	}
-
+#endif
 	early_identify_cpu(&boot_cpu_data);
 }
 
#2 lore raw

Re: [tip:x86/debug] x86: Minimise printk spew from per-vendor init code

Quoted 53 lines · tip-bot for Dave Jones

Commit-ID:  0388423dba2217b4e5b6c61690b0506d13b25a49
Gitweb:     http://git.kernel.org/tip/0388423dba2217b4e5b6c61690b0506d13b25a49
Author:     Dave Jones <[email protected]>
AuthorDate: Fri, 13 Nov 2009 15:30:00 -0500
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sat, 14 Nov 2009 01:18:05 +0100

x86: Minimise printk spew from per-vendor init code

In the default case where the kernel supports all CPU vendors, we currently print out a bunch of not useful messages on every system.

32-bit:
KERNEL supported cpus:
 Intel GenuineIntel
 AMD AuthenticAMD
 NSC Geode by NSC
 Cyrix CyrixInstead
 Centaur CentaurHauls
 Transmeta GenuineTMx86
 Transmeta TransmetaCPU
 UMC UMC UMC UMC

64-bit:
KERNEL supported cpus:
 Intel GenuineIntel
 AMD AuthenticAMD
 Centaur CentaurHauls

Given that "what CPUs does the kernel support" isn't useful for the "support everything" case, we can suppress these printk's.

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/cpu/common.c |    3 ++-

 1 files changed, 2 insertions(+), 1 deletions(-)
arch/x86/kernel/cpu/common.c +1 -0
index cc25c2b..617a29f 100644
@@ -656,6 +656,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
 
  void __init early_cpu_init(void)
  {
+#ifdef PROCESSOR_SELECT
        const struct cpu_dev *const *cdev;
        int count = 0;
 

arch/x86/kernel/cpu/common.c void __init early_cpu_init(void) · line 682

Quoted 7 lines
arch/x86/kernel/cpu/common.c +1 -1
@@ -676,7 +677,7 @@ void __init early_cpu_init(void)
                                cpudev->c_ident[j]);
                }
        }
-
+#endif
        early_identify_cpu(&boot_cpu_data);
  }

NACK.

the function is initializing cpu_devs array.

YH

author
#3 lore raw

Re: [tip:x86/debug] x86: Minimise printk spew from per-vendor init code

Quoted 21 lines · Yinghai Lu
Quoted 11 lines
arch/x86/kernel/cpu/common.c +1 -0
@@ -656,6 +656,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
 
  void __init early_cpu_init(void)
  {
+#ifdef PROCESSOR_SELECT
        const struct cpu_dev *const *cdev;
        int count = 0;
 

arch/x86/kernel/cpu/common.c void __init early_cpu_init(void) · line 682

Quoted 7 lines
arch/x86/kernel/cpu/common.c +1 -1
@@ -676,7 +677,7 @@ void __init early_cpu_init(void)
                                cpudev->c_ident[j]);
                }
        }
-
+#endif
        early_identify_cpu(&boot_cpu_data);
  }

NACK.

Quoted 1 line

the function is initializing cpu_devs array.

Ugh, I don't know how I missed that. I also seem to have boot tested the wrong kernel. Back to the drawing board.

Dave

#4 lore raw

Re: [tip:x86/debug] x86: Minimise printk spew from per-vendor init code

Quoted 25 lines · Dave Jones

On Fri, Nov 13, 2009 at 05:03:44PM -0800, Yinghai Lu wrote:

 > > --- a/arch/x86/kernel/cpu/common.c
 > > +++ b/arch/x86/kernel/cpu/common.c
 > > @@ -656,6 +656,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c) > >
 > >  void __init early_cpu_init(void)
 > >  {
 > > +#ifdef PROCESSOR_SELECT
 > >        const struct cpu_dev *const *cdev;
 > >        int count = 0;
 > >
 > > @@ -676,7 +677,7 @@ void __init early_cpu_init(void)
 > >                                cpudev->c_ident[j]);
 > >                }
 > >        }
 > > -
 > > +#endif
 > >        early_identify_cpu(&boot_cpu_data);
 > >  }
 >
 > NACK.
 >
 > the function is initializing cpu_devs array.

Quoted 3 lines

Ugh, I don't know how I missed that.  I also seem to have boot tested the wrong kernel. Back to the drawing board.

use two loop instead?

YH

#5 lore raw

Re: [tip:x86/debug] x86: Minimise printk spew from per-vendor init code

In reply to Yinghai Lu
Quoted 65 lines · Yinghai Lu
Quoted 53 lines · tip-bot for Dave Jones

Commit-ID: ?0388423dba2217b4e5b6c61690b0506d13b25a49
Gitweb: ? ? http://git.kernel.org/tip/0388423dba2217b4e5b6c61690b0506d13b25a49
Author: ? ? Dave Jones <[email protected]>
AuthorDate: Fri, 13 Nov 2009 15:30:00 -0500
Committer: ?Ingo Molnar <[email protected]>
CommitDate: Sat, 14 Nov 2009 01:18:05 +0100

x86: Minimise printk spew from per-vendor init code

In the default case where the kernel supports all CPU vendors, we currently print out a bunch of not useful messages on every system.

32-bit:
KERNEL supported cpus:
?Intel GenuineIntel
?AMD AuthenticAMD
?NSC Geode by NSC
?Cyrix CyrixInstead
?Centaur CentaurHauls
?Transmeta GenuineTMx86
?Transmeta TransmetaCPU
?UMC UMC UMC UMC

64-bit:
KERNEL supported cpus:
?Intel GenuineIntel
?AMD AuthenticAMD
?Centaur CentaurHauls

Given that "what CPUs does the kernel support" isn't useful for the "support everything" case, we can suppress these printk's.

LKML-Reference: <[email protected]>

---
?arch/x86/kernel/cpu/common.c | ? ?3 ++-
?1 files changed, 2 insertions(+), 1 deletions(-)

arch/x86/kernel/cpu/common.c +1 -0
index cc25c2b..617a29f 100644
@@ -656,6 +656,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
 
 ?void __init early_cpu_init(void)
 ?{
+#ifdef PROCESSOR_SELECT
 ? ? ? ?const struct cpu_dev *const *cdev;
 ? ? ? ?int count = 0;
 

arch/x86/kernel/cpu/common.c void __init early_cpu_init(void) · line 682

Quoted 7 lines
arch/x86/kernel/cpu/common.c +1 -1
@@ -676,7 +677,7 @@ void __init early_cpu_init(void)
 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?cpudev->c_ident[j]);
 ? ? ? ? ? ? ? ?}
 ? ? ? ?}
-
+#endif
 ? ? ? ?early_identify_cpu(&boot_cpu_data);
 ?}

NACK.

Quoted 1 line

the function is initializing cpu_devs array.

Good point. I fixed this.

Ingo

#6 lore raw

[tip:x86/debug] x86: Fix cpu_devs[] initialization in early_cpu_init()

In reply to Dave Jones
Commit-ID:  31c997cac76e62918858a432fff6e43fd48425f9
Gitweb:     http://git.kernel.org/tip/31c997cac76e62918858a432fff6e43fd48425f9
Author:     Ingo Molnar <[email protected]>
AuthorDate: Sat, 14 Nov 2009 10:34:41 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sat, 14 Nov 2009 10:36:50 +0100

x86: Fix cpu_devs[] initialization in early_cpu_init()

Yinghai Lu noticed that this commit:

0388423: x86: Minimise printk spew from per-vendor init code

mistakenly left out the initialization of cpu_devs[] in the !PROCESSOR_SELECT case. Fix it.

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/cpu/common.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)
arch/x86/kernel/cpu/common.c +14 -8
index 9db1e24..61242a5 100644
@@ -651,28 +651,34 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
 
 void __init early_cpu_init(void)
 {
-#ifdef PROCESSOR_SELECT
 	const struct cpu_dev *const *cdev;
 	int count = 0;
 
+#ifdef PROCESSOR_SELECT
 	printk(KERN_INFO "KERNEL supported cpus:\n");
+#endif
+
 	for (cdev = __x86_cpu_dev_start; cdev < __x86_cpu_dev_end; cdev++) {
 		const struct cpu_dev *cpudev = *cdev;
-		unsigned int j;
 
 		if (count >= X86_VENDOR_NUM)
 			break;
 		cpu_devs[count] = cpudev;
 		count++;
 
-		for (j = 0; j < 2; j++) {
-			if (!cpudev->c_ident[j])
-				continue;
-			printk(KERN_INFO "  %s %s\n", cpudev->c_vendor,
-				cpudev->c_ident[j]);
+#ifdef PROCESSOR_SELECT
+		{
+			unsigned int j;
+
+			for (j = 0; j < 2; j++) {
+				if (!cpudev->c_ident[j])
+					continue;
+				printk(KERN_INFO "  %s %s\n", cpudev->c_vendor,
+					cpudev->c_ident[j]);
+			}
 		}
-	}
 #endif
+	}
 	early_identify_cpu(&boot_cpu_data);
 }