-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hans Reiser wrote:
> Mike Benoit wrote:
> 
>> This seems strange, because to me this type of workload would lend
>> itself to being less fragmented then most workloads. All the box does is
>> records TV programs, so over the course of 30-60min periods I would
>> guess 95+% of the writes are sequential. 
>>
>> Why would the fragmentation be so bad? Is there a way to tell what the
>> fragmentation rate is?
>>
>> Thanks.
>>
>>  
>>
> I wonder how the bitmap optimizations that Jeff added handle this usage
> pattern.  Jeff?

That's certainly interesting. The bitmap hinting code should skip bitmap
blocks with fewer blocks that are being asked for. The first zero hint
patch was never applied to mainline. I have that in my queue as well.

Try using the attached patch. It directs the block allocator to start
the search at the first known 0 bit rather than scanning the entire
block to find it. I'm not sure if will have a meaningful performance
impact, but it's worth a try.

- -Jeff

- --
Jeff Mahoney
SUSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFEpVWRLPWxlyuTD7IRAm1uAJwIExdMY1ju2VjnVFmbweEluNUi+QCgqZWL
rNWRcVDW0KqBCrvUl1L4veE=
=Cuir
-----END PGP SIGNATURE-----
From: Jeff Mahoney <[EMAIL PROTECTED]>
Subject: [PATCH 5/5] reiserfs: make bitmap use cached first zero bit

 Currently, the bitmap code uses half of the hinting data gathered and cached
 and wastes the other half. We'll skip completely full bitmaps, but start
 scanning in bitmaps at locations where if we consulted the zero bit hint,
 we'd know there aren't any free bits available.

 This patch uses the first zero hint to bump the beginning of the search
 window to where we know there is at least one zero bit.

 fs/reiserfs/bitmap.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

Signed-off-by: Jeff Mahoney <[EMAIL PROTECTED]>

diff -ruNpX ../dontdiff linux-2.6.15.orig.staging1/fs/reiserfs/bitmap.c linux-2.6.15.orig.staging2/fs/reiserfs/bitmap.c
--- linux-2.6.15.orig.staging1/fs/reiserfs/bitmap.c	2006-01-16 16:53:35.663319136 -0500
+++ linux-2.6.15.orig.staging2/fs/reiserfs/bitmap.c	2006-01-16 16:53:35.673317616 -0500
@@ -187,7 +187,10 @@ static int scan_bitmap_block(struct reis
 			return 0;	// No free blocks in this bitmap
 		}
 
-		/* search for a first zero bit -- beggining of a window */
+		if (*beg < bi->first_zero_hint)
+			*beg = bi->first_zero_hint;
+
+		/* search for a first zero bit -- beginning of a window */
 		*beg = reiserfs_find_next_zero_le_bit
 		    ((unsigned long *)(bh->b_data), boundary, *beg);
 

Reply via email to