Hi,
I think short circuiting data_unlock requests in ext2fs (by allocating
the page in file_pager_read_page and returning it unlocked) could
improve file growing performance a bit.
I've tested it in qemu (with kvm), using "dd" to sequentially write
blocks to a file, obtaining an improvement of 10%. I'd like to test it
in real hardware, but currently I don't have a spare machine to do
that. If someone can try it (it's a small patch, and it just requires
to rebuild ext2fs), please let us know the results.
Thanks!
--- ext2fs/pager.c.orig 2010-05-11 18:40:40.000000000 +0200
+++ ext2fs/pager.c 2010-05-11 18:42:27.000000000 +0200
@@ -250,7 +250,11 @@
if (block == 0)
/* Reading unallocated block, just make a zero-filled one. */
{
- *writelock = 1;
+ if (lock) {
+ rwlock_reader_unlock (lock);
+ lock = NULL;
+ }
+ pager_unlock_page(pager_get_upi(node->dn->pager), page);
if (offs == 0)
/* No page allocated to read into yet. */
{