linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Prasanna Meda <pmeda@akamai.com>
To: Theodore Ts'o <tytso@mit.edu>,
	akpm@osdl.org, jack@suse.cz, linux-mm@kvack.org
Subject: test_root reorder(Re: [patch] ext2: Apply Jack's ext3 speedups)
Date: Fri, 28 Jan 2005 19:11:46 -0800	[thread overview]
Message-ID: <41FAFEF1.B13D59BA@akamai.com> (raw)
In-Reply-To: <41FAED57.DFCF1D22@akamai.com>

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

Prasanna Meda wrote:

>   - Folded all three root checkings for 3,  5 and 7 into one loop.
>   -  Short cut the loop with 3**n < 5 **n < 7**n logic.
>   -  Even numbers can be ruled out.

Without going to that complicated path, the better performance
is achieved with just reordering  of the tests from 3,5,7 to 7,5.3, so
that average case becomes better. This is more simpler than
 folding  patch.


Thanks,
Prasanna.


[-- Attachment #2: ext3_test_root_reorder.patch --]
[-- Type: text/plain, Size: 524 bytes --]



 Reorder test_root testing from 3,5,7 to 7,5,3 so
 that average case becomes good. Even number check
 is added. 

 Signed-off-by: Prasanna Meda <pmeda@akamai.com>

--- a/fs/ext3/balloc.c	Fri Jan 28 22:21:45 2005
+++ b/fs/ext3/balloc.c	Sat Jan 29 02:51:39 2005
@@ -1451,8 +1451,10 @@
 {
 	if (group <= 1)
 		return 1;
-	return (test_root(group, 3) || test_root(group, 5) ||
-		test_root(group, 7));
+	if (!(group & 1))
+		return 0;
+	return (test_root(group, 7) || test_root(group, 5) ||
+		test_root(group, 3));
 }
 
 /**

  parent reply	other threads:[~2005-01-29  3:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-27  7:22 [patch] ext2: Apply Jack's ext3 speedups pmeda
2005-01-27 20:52 ` Theodore Ts'o
2005-01-27 21:11   ` Andrew Morton
2005-01-27 21:41     ` Theodore Ts'o
2005-01-29  1:56   ` Prasanna Meda
2005-01-29  2:00     ` Prasanna Meda
2005-01-29  3:11     ` Prasanna Meda [this message]
2005-01-31  9:51       ` test_root reorder(Re: [patch] ext2: Apply Jack's ext3 speedups) Jan Kara
2005-01-31 19:19         ` Prasanna Meda

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=41FAFEF1.B13D59BA@akamai.com \
    --to=pmeda@akamai.com \
    --cc=akpm@osdl.org \
    --cc=jack@suse.cz \
    --cc=linux-mm@kvack.org \
    --cc=tytso@mit.edu \
    /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