lkml.org 
[lkml]   [2012]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] x86: memtest: remove unnecessary round to leave memtest with zeroed mem
Date
By just reversing the order memtest is using the test patterns, an
additional round to zero the memory is not necessary.

This makes it a bit faster.

Signed-off-by: Alexander Holler <holler@ahsoftware.de>
---
arch/x86/mm/memtest.c | 11 ++---------
1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/arch/x86/mm/memtest.c b/arch/x86/mm/memtest.c
index 855a6d5..da80083 100644
--- a/arch/x86/mm/memtest.c
+++ b/arch/x86/mm/memtest.c
@@ -9,7 +9,7 @@
#include <linux/memblock.h>

static u64 patterns[] __initdata = {
- 0,
+ 0, /* Has has to be 0 to leave memtest with zeroed memory */
0xffffffffffffffffULL,
0x5555555555555555ULL,
0xaaaaaaaaaaaaaaaaULL,
@@ -112,15 +112,8 @@ void __init early_memtest(unsigned long start, unsigned long end)
return;

pr_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);
- }
}
--
1.7.8.6


\
 
 \ /
  Last update: 2012-11-21 18:01    [W:0.048 / U:0.980 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site