Re: delalloc fragmenting files?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



please, try the patch attached.

thanks, Alex

Eric Sandeen wrote:
One thing that seems to be happening is that thanks to delalloc, a nice
big request is coming in (only 1036 blocks of the 4096, not quite sure
why), but then it gets into ext4_mb_normalize_request(), which finds the
most blocks it can "preallocate" is 256, and chops down the request to
256 blocks.  Shouldn't this preallocation be over & above what was asked
for, vs. reducing the request?

Ok, so, we get allocations in 256-block chunks...  Why they don't all
come out contiguous, I don't know yet...

-Eric

Index: linux-2.6.24-rc1/fs/ext4/mballoc.c
===================================================================
--- linux-2.6.24-rc1.orig/fs/ext4/mballoc.c	2007-10-27 10:29:17.000000000 +0400
+++ linux-2.6.24-rc1/fs/ext4/mballoc.c	2007-10-27 22:14:54.000000000 +0400
@@ -3088,8 +3088,10 @@ static void ext4_mb_normalize_request(st
 			break;
 		}
 	}
+	size = wind;
+
 	if (wind == 0) {
-		__u64 tstart;
+		__u64 tstart, tend;
 		/* file is quite large, we now preallocate with
 		 * the biggest configured window with regart to
 		 * logical offset */
@@ -3097,8 +3099,11 @@ static void ext4_mb_normalize_request(st
 		tstart = ac->ac_o_ex.fe_logical;
 		do_div(tstart, wind);
 		start = tstart * wind;
+		tend = ac->ac_o_ex.fe_logical + ac->ac_o_ex.fe_len - 1;
+		do_div(tend, wind);
+		tend = tend * wind + wind;
+		size = tend - start;
 	}
-	size = wind;
 	orig_size = size;
 	orig_start = start;
 

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux