Linux RAID subsystem development
 help / color / mirror / Atom feed
From: Josh Litherland <josh@emperorlinux.com>
To: linux-raid@vger.kernel.org
Cc: research@emperorlinux.com
Subject: [PATCH] XOR template selection redo
Date: Mon, 21 Jun 2004 11:26:28 -0400	[thread overview]
Message-ID: <1087831588.3094.10.camel@JubJub> (raw)

[-- Attachment #1: Type: text/plain, Size: 721 bytes --]


Okay, due to my wonky printk's the previous patch was pretty lousy at
its stated purpose of reducing confusion.  Attached is a better
version.  I tried to keep output mostly consistant, so:


raid5: measuring checksumming speed
   8regs     :  1900.000 MB/sec
   8regs_prefetch:  2396.000 MB/sec
   32regs    :  1652.000 MB/sec
   32regs_prefetch:  1700.000 MB/sec
   pIII_sse  :  1904.000 MB/sec
   pII_mmx   :  4696.000 MB/sec
   p5_mmx    :  6252.000 MB/sec
raid5: using function: p5_mmx (6252.000 MB/sec)

and

raid5: automatically using best checksumming function: pIII_sse
   pIII_sse  :  2280.000 MB/sec
raid5: using function: pIII_sse (2280.000 MB/sec)

-- 
Josh Litherland <josh@emperorlinux.com>
Emperor Linux

[-- Attachment #2: xor-selection-good.diff --]
[-- Type: text/x-patch, Size: 1648 bytes --]

diff -drauN linux-2.6.7/drivers/md/xor.c linux-2.6.7.new/drivers/md/xor.c
--- linux-2.6.7/drivers/md/xor.c	2004-06-16 01:19:23.000000000 -0400
+++ linux-2.6.7.new/drivers/md/xor.c	2004-06-21 11:08:33.000000000 -0400
@@ -108,29 +108,40 @@
 	}
 	b2 = b1 + 2*PAGE_SIZE + BENCH_SIZE;
 
-	printk(KERN_INFO "raid5: measuring checksumming speed\n");
+	/*
+	 * If this arch/cpu has a short-circuited selection, don't loop through all
+	 * the possible functions, just test the best one
+	 */
 
+	fastest = NULL;
+
+#ifdef XOR_SELECT_TEMPLATE
+		fastest = XOR_SELECT_TEMPLATE(fastest);
+#endif
+	
 #define xor_speed(templ)	do_xor_speed((templ), b1, b2)
 
-	XOR_TRY_TEMPLATES;
+	if (fastest) {
+		printk(KERN_INFO "raid5: automatically using best checksumming function: %s\n",
+			fastest->name);
+		xor_speed(fastest);
+	} else {
+		printk(KERN_INFO "raid5: measuring checksumming speed\n");
+		XOR_TRY_TEMPLATES;
+		fastest = template_list;
+		for (f = fastest; f; f = f->next) 
+			if (f->speed > fastest->speed)
+				fastest = f;
+	}
+
+	printk("raid5: using function: %s (%d.%03d MB/sec)\n",
+	       fastest->name, fastest->speed / 1000, fastest->speed % 1000);
 
 #undef xor_speed
 
 	free_pages((unsigned long)b1, 2);
 
-	fastest = template_list;
-	for (f = fastest; f; f = f->next)
-		if (f->speed > fastest->speed)
-			fastest = f;
-
-#ifdef XOR_SELECT_TEMPLATE
-	fastest = XOR_SELECT_TEMPLATE(fastest);
-#endif
-
 	active_template = fastest;
-	printk("raid5: using function: %s (%d.%03d MB/sec)\n",
-	       fastest->name, fastest->speed / 1000, fastest->speed % 1000);
-
 	return 0;
 }
 

                 reply	other threads:[~2004-06-21 15:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1087831588.3094.10.camel@JubJub \
    --to=josh@emperorlinux.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=research@emperorlinux.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