1 Nov 2004 16:32
[PATCH RFC] O_DIRECT reads and writes without i_sem
Chris Mason <mason <at> suse.com>
2004-11-01 15:32:07 GMT
2004-11-01 15:32:07 GMT
Hello everyone, Right now, O_DIRECT reads and writes on regular files have to take i_sem while reading file metadata in order to make sure we don't race with hole filling. This patch tries to get around that by avoiding i_sem when we are doing an O_DIRECT read or write inside of i_size. Yet another rw semaphore is added to struct inode to protect against holes being filled during the O_DIRECT. direct-io.c gets another special case to be aware of the locking. This has only been lightly tested, I'm posting here for general comments before I go much further. I'm rounding up some hardware with enough disks to benchmark it properly. Only ext2 and reiserfs are modified to drop i_sem during O_DIRECT. ext3 needs some care around the orphan lists, and I didn't want to get into that until the rest of the patch was working. -chris [patch against 2.6.10-rc1-mm2] Index: linux.mm/fs/direct-io.c =================================================================== --- linux.mm.orig/fs/direct-io.c 2004-11-01 09:34:24.000000000 -0500 +++ linux.mm/fs/direct-io.c 2004-11-01 09:34:40.000000000 -0500 <at> <at> -915,7 +915,7 <at> <at> out: }(Continue reading)
RSS Feed