All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Beregalov <a.beregalov@gmail.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: linux-ide@vger.kernel.org
Subject: Re: [PATCH] sata_sx4: speed up ECC initialization
Date: Wed, 15 Apr 2009 00:00:54 +0400	[thread overview]
Message-ID: <20090414200054.GB17134@orion> (raw)
In-Reply-To: <49E47A45.60902@garzik.org>

On Tue, Apr 14, 2009 at 07:57:57AM -0400, Jeff Garzik wrote:
> Alexander Beregalov wrote:
> > ECC initialization takes too long. It writes zeroes by portions of 4
> > byte, it takes more than 6 minutes to initialize 512Mb DIMM module.
> > Change portion to 1Mb.
> > 
> > before:
> > [10857.207576] pdc20621_dimm_init: Start ECC initialization
> > [11235.333118] pdc20621_dimm_init: Finish ECC initialization
> > 
> > after:
> > [ 1005.126437] pdc20621_dimm_init: Local DIMM Speed = 100
> > [ 1005.128111] pdc20621_dimm_init: Local DIMM Size = 512MB
> > [ 1005.133508] Local DIMM ECC Enabled
> > [ 1005.236482] pdc20621_dimm_init: Start ECC initialization
> > [ 1031.278098] pdc20621_dimm_init: Finish ECC initialization
> > 
> Comments:
> 
> 1) on an older machine, where these things might be found, 1MB might be 
> a lot -- particularly if there is a lot of VM fragmentation.  Please 
> reduce the size a bit -- I suppose 128k is not unbearably slow?
> 
> 2) Rather than repeating 'page size * 32' calculation multiple times, 
> put it into a named constant somewhere.
> 
> Other than that, looks ok!


>From 00e980a4651ef12811fbe9a893a7e72510b955d1 Mon Sep 17 00:00:00 2001
From: Alexander Beregalov <a.beregalov@gmail.com>
Date: Tue, 14 Apr 2009 23:55:52 +0400
Subject: [PATCH v2] sata_sx4: speed up ECC initialization

ECC initialization takes too long. It writes zeroes by portions
of 4 byte, it takes more than 6 minutes on my machine to initialize
512Mb ECC DIMM module. Change portion to 128Kb - it significantly
reduces initialization time.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
---
 drivers/ata/sata_sx4.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/ata/sata_sx4.c b/drivers/ata/sata_sx4.c
index dce3dcc..197a4d7 100644
--- a/drivers/ata/sata_sx4.c
+++ b/drivers/ata/sata_sx4.c
@@ -193,6 +193,7 @@ enum {
 					  PDC_TIMER_MASK_INT,
 };
 
+#define ECC_ERASE_BUF 128 * 1024;
 
 struct pdc_port_priv {
 	u8			dimm_buf[(ATA_PRD_SZ * ATA_MAX_PRD) + 512];
@@ -1208,7 +1209,6 @@ static unsigned int pdc20621_dimm_init(struct ata_host *host)
 {
 	int speed, size, length;
 	u32 addr, spd0, pci_status;
-	u32 tmp = 0;
 	u32 time_period = 0;
 	u32 tcount = 0;
 	u32 ticks = 0;
@@ -1323,14 +1323,17 @@ static unsigned int pdc20621_dimm_init(struct ata_host *host)
 	pdc20621_i2c_read(host, PDC_DIMM0_SPD_DEV_ADDRESS,
 			  PDC_DIMM_SPD_TYPE, &spd0);
 	if (spd0 == 0x02) {
+		void *buf;
 		VPRINTK("Start ECC initialization\n");
 		addr = 0;
 		length = size * 1024 * 1024;
+		buf = kzalloc(ECC_ERASE_BUF, GFP_KERNEL);
 		while (addr < length) {
-			pdc20621_put_to_dimm(host, (void *) &tmp, addr,
-					     sizeof(u32));
-			addr += sizeof(u32);
+			pdc20621_put_to_dimm(host, buf, addr,
+					     ECC_ERASE_BUF);
+			addr += ECC_ERASE_BUF;
 		}
+		kfree(buf);
 		VPRINTK("Finish ECC initialization\n");
 	}
 	return 0;
-- 
1.6.2.3


  reply	other threads:[~2009-04-14 20:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-14  2:26 [PATCH] sata_sx4: speed up ECC initialization Alexander Beregalov
2009-04-14 11:57 ` Jeff Garzik
2009-04-14 20:00   ` Alexander Beregalov [this message]
2009-04-14 20:21     ` Jeff Garzik
2009-04-14 20:51       ` Alexander Beregalov
2009-04-15  8:02         ` Mikael Pettersson
2009-05-16  6:29         ` Jeff Garzik
2009-05-16 13:29           ` Alexander Beregalov
2009-05-16 19:11             ` Jeff Garzik
2009-05-16 19:17               ` Alexander Beregalov

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=20090414200054.GB17134@orion \
    --to=a.beregalov@gmail.com \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.