linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Prasanna Meda <pmeda@akamai.com>
Cc: Theodore Ts'o <tytso@mit.edu>, akpm@osdl.org, linux-mm@kvack.org
Subject: Re: test_root reorder(Re: [patch] ext2: Apply Jack's ext3 speedups)
Date: Mon, 31 Jan 2005 10:51:48 +0100	[thread overview]
Message-ID: <20050131095148.GB2482@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <41FAFEF1.B13D59BA@akamai.com>

> 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.
  I like a bit more just to reorder the tests (though I agree that your
joined tests for 3,5,7 are probably faster) - it looks much more
readable...

>  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));
>  }
>  
>  /**

								Honza

-- 
Jan Kara <jack@suse.cz>
SuSE CR Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  reply	other threads:[~2005-01-31  9:51 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     ` test_root reorder(Re: [patch] ext2: Apply Jack's ext3 speedups) Prasanna Meda
2005-01-31  9:51       ` Jan Kara [this message]
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=20050131095148.GB2482@atrey.karlin.mff.cuni.cz \
    --to=jack@suse.cz \
    --cc=akpm@osdl.org \
    --cc=linux-mm@kvack.org \
    --cc=pmeda@akamai.com \
    --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