mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Holler <holler@ahsoftware.de>
To: linux-kernel@vger.kernel.org
Cc: richard -rw- weinberger <richard.weinberger@gmail.com>,
	Alexander Holler <holler@ahsoftware.de>
Subject: [PATCH 2/2] x86: memtest: remove unnecessary round to leave memtest with zeroed mem
Date: Wed, 21 Nov 2012 17:24:11 +0100	[thread overview]
Message-ID: <1353515051-11605-2-git-send-email-holler@ahsoftware.de> (raw)
In-Reply-To: <1353515051-11605-1-git-send-email-holler@ahsoftware.de>

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


      reply	other threads:[~2012-11-21 16:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-09 13:12 [PATCH] x86: memtest: make it a bit faster Alexander Holler
2012-11-09 14:21 ` richard -rw- weinberger
2012-11-09 14:27   ` Alexander Holler
2012-11-21 16:18     ` Alexander Holler
2012-11-21 16:24       ` [PATCH 1/2] x86: memtest: checkpatch and emergency warning if memtest fails Alexander Holler
2012-11-21 16:24         ` Alexander Holler [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1353515051-11605-2-git-send-email-holler@ahsoftware.de \
    --to=holler@ahsoftware.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard.weinberger@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome