Skip to contentSkip to conversation

x86: memtest: shorten time for tests

PATCH New Alexander Holler 2 participants 2 messages Feb 16, 2013 – Feb 18, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: memtest: shorten time for tests

By just reversing the order memtest is using the test patterns, an additional round to zero the memory is not necessary.

This might save up to a second or even more for setups which are doing tests on every boot.

---
 arch/x86/mm/memtest.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
arch/x86/mm/memtest.c +2 -8
index c80b9fb..8dabbed 100644
@@ -9,6 +9,7 @@
 #include <linux/memblock.h>
 
 static u64 patterns[] __initdata = {
+	/* The first entry has to be 0 to leave memtest with zeroed memory */
 	0,
 	0xffffffffffffffffULL,
 	0x5555555555555555ULL,
@@ -110,15 +111,8 @@ void __init early_memtest(unsigned long start, unsigned long end)
 		return;
 
 	printk(KERN_INFO "early_memtest: # of tests: %d\n", memtest_pattern);
-	for (i = 0; i < memtest_pattern; i++) {
+	for (i = memtest_pattern-1; i < UINT_MAX; --i) {
 		idx = i % ARRAY_SIZE(patterns);
 		do_one_pass(patterns[idx], start, end);
 	}
-
-	if (idx > 0) {
-		printk(KERN_INFO "early_memtest: wipe out "
-		       "test pattern from memory\n");
-		/* additional test with pattern 0 will do this */
-		do_one_pass(0, start, end);
-	}
 }
Signature · 1 line
1.8.1.2
#1 lore raw

[tip:x86/debug] x86/memtest: Shorten time for tests

x86/memtest: Shorten time for tests
Commit-ID:  20bf062c6575e162ede00308ca3a5714ca112009
Gitweb:     http://git.kernel.org/tip/20bf062c6575e162ede00308ca3a5714ca112009
Author:     Alexander Holler <[email protected]>
AuthorDate: Sat, 16 Feb 2013 16:38:17 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 18 Feb 2013 09:28:42 +0100

x86/memtest: Shorten time for tests

By just reversing the order memtest is using the test patterns, an additional round to zero the memory is not necessary.

This might save up to a second or even more for setups which are doing tests on every boot.

---
 arch/x86/mm/memtest.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
arch/x86/mm/memtest.c +2 -8
index c80b9fb..8dabbed 100644
@@ -9,6 +9,7 @@
 #include <linux/memblock.h>
 
 static u64 patterns[] __initdata = {
+	/* The first entry has to be 0 to leave memtest with zeroed memory */
 	0,
 	0xffffffffffffffffULL,
 	0x5555555555555555ULL,
@@ -110,15 +111,8 @@ void __init early_memtest(unsigned long start, unsigned long end)
 		return;
 
 	printk(KERN_INFO "early_memtest: # of tests: %d\n", memtest_pattern);
-	for (i = 0; i < memtest_pattern; i++) {
+	for (i = memtest_pattern-1; i < UINT_MAX; --i) {
 		idx = i % ARRAY_SIZE(patterns);
 		do_one_pass(patterns[idx], start, end);
 	}
-
-	if (idx > 0) {
-		printk(KERN_INFO "early_memtest: wipe out "
-		       "test pattern from memory\n");
-		/* additional test with pattern 0 will do this */
-		do_one_pass(0, start, end);
-	}
 }