public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] remove BKL from ext2's readdir
@ 2003-03-15 10:13 Alex Tomas
  2003-03-15 10:36 ` Andrew Morton
  0 siblings, 1 reply; 11+ messages in thread
From: Alex Tomas @ 2003-03-15 10:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: ext2-devel, Andrew Morton


hi!

I took a look at readdir() in 2.5.64's ext2 and found it serialized by BKL.
As far as I see in sources, there is no need in this BKL. So, here is small
patch and some benchmarks. of course, the result was expected pretty much ;)


             500         1000
readdir+BKL: 0m11.793s   0m23.403s
readdir-BKL: 0m6.060s    0m12.113s

description: two processes read own dir populated by files (500 and 1000 files).
this repeats for 100000 times. the iron is dual 1GHz P3.


diff -uNr linux/fs/ext2/dir.c edited/fs/ext2/dir.c
--- linux/fs/ext2/dir.c	Sat Mar 15 13:08:24 2003
+++ edited/fs/ext2/dir.c	Sat Mar 15 13:08:11 2003
@@ -259,8 +259,6 @@
 	int need_revalidate = (filp->f_version != inode->i_version);
 	int ret = 0;
 
-	lock_kernel();
-
 	if (pos > inode->i_size - EXT2_DIR_REC_LEN(1))
 		goto done;
 
@@ -313,7 +311,6 @@
 	filp->f_pos = (n << PAGE_CACHE_SHIFT) | offset;
 	filp->f_version = inode->i_version;
 	UPDATE_ATIME(inode);
-	unlock_kernel();
 	return 0;
 }
 


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2003-03-15 21:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <m3vfyluedb.fsf@lexa.home.net.suse.lists.linux.kernel>
     [not found] ` <20030315023614.3e28e67b.akpm@digeo.com.suse.lists.linux.kernel>
2003-03-15 21:55   ` [PATCH] remove BKL from ext2's readdir Andi Kleen
2003-03-15 22:03     ` Andrew Morton
2003-03-15 10:13 Alex Tomas
2003-03-15 10:36 ` Andrew Morton
2003-03-15 11:03   ` Andrew Morton
2003-03-15 16:22     ` Alex Tomas
2003-03-15 20:11       ` Andrew Morton
2003-03-15 20:09         ` Alex Tomas
2003-03-15 20:24           ` Andrew Morton
2003-03-15 20:19             ` Alex Tomas
2003-03-15 16:31   ` Robert Love

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox