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

Re: [Ext2-devel] Re: Debbugs: The Next Generation

On Sat, Aug 18, 2001 at 06:48:08AM -0500, Adam Heath wrote:
> Your patch doesn't appear to be helping my code out.  But I'd need to reboot
> again to be certain.

If you could send me more particulars of exactly what your code is
doing, I'd appreciate it.  

> Actually, as I watch my status bar, the code is slowing down as it gets
> further and further into the directory.

Are you sure that's with the patch applied?  If you're reading in
readdir order, slowing down as you get further and further into the
directory is consistent with the original kernel behaviour.  But with
the kernel patch, the time to do a directory lookup shouldn't change
as you get deeper into the directory.

My own quick tests shows significant improvement.  With a test load
created using "seq 1 50000 | xargs touch", "/usr/bin/time ls -l" on
that directory have the following results.

Before (using 2.4.8 on an ext2 filesystem):

2.69user 180.24system 3:03.34elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (201major+3925minor)pagefaults 0swaps

After applying my patch:

2.47user 1.71system 0:04.67elapsed 89%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (201major+3925minor)pagefaults 0swaps

Note: in order to get repeatable results, you must unmount and remount
the filesystem to clear the dentry cache.  Otherwise you won't see
much of a difference if the directory fits in the dentry cache, since
after the first time you make a pass over the directory, the linux
filesystem can handle requests from the dcache, and so the low-level
filesystem routines rarely gets called after that point.

						- Ted

Reply to: