[PATCH] not sleep while holding a locked page in block_truncate_page

From: Marcelo Tosatti (marcelo@conectiva.com.br)
Date: Thu Dec 28 2000 - 10:18:43 EST


Hi Linus,

block_truncate_page() function unecessarily calls mark_buffer_dirty(),
which may wait on bdflush, while holding a locked page.

The following patch against 2.4.0test13pre4 makes block_truncate_page call
balance_dirty() (which may wait for bdflush) after when we unlocked the
page and decrement its counter.

Comments?

--- linux.orig/fs/buffer.c.orig Thu Dec 28 15:01:01 2000
+++ linux/fs/buffer.c Thu Dec 28 15:01:40 2000
@@ -1909,12 +1909,13 @@
        flush_dcache_page(page);
        kunmap(page);
 
- mark_buffer_dirty(bh);
+ __mark_buffer_dirty(bh);
        err = 0;
 
 unlock:
        UnlockPage(page);
        page_cache_release(page);
+ balance_dirty(bh->b_dev);
 out:
        return err;
 }

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Dec 31 2000 - 21:00:11 EST