[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1HVEGF-0006d2-00@dorka.pomaz.szeredi.hu>
Date: Sat, 24 Mar 2007 22:58:55 +0100
From: Miklos Szeredi <miklos@...redi.hu>
To: akpm@...ux-foundation.org
CC: dgc@....com, linux-kernel@...r.kernel.org
Subject: [patch 3/3] balance dirty pages from loop device
From: Miklos Szeredi <mszeredi@...e.cz>
The function do_lo_send_aops() should call
balance_dirty_pages_ratelimited() after each page similarly to
generic_file_buffered_write().
Without this, writing the loop device directly (not through a
filesystem) is very slow, and also slows the whole system down,
because nr_dirty is constantly over the limit.
Beware: this patch without the fix to balance_dirty_pages() makes a
loopback mounted filesystem prone to deadlock.
Signed-off-by: Miklos Szeredi <mszeredi@...e.cz>
---
Index: linux/drivers/block/loop.c
===================================================================
--- linux.orig/drivers/block/loop.c 2007-03-24 21:00:40.000000000 +0100
+++ linux/drivers/block/loop.c 2007-03-24 22:07:06.000000000 +0100
@@ -275,6 +275,8 @@ static int do_lo_send_aops(struct loop_d
pos += size;
unlock_page(page);
page_cache_release(page);
+ balance_dirty_pages_ratelimited(mapping);
+ cond_resched();
}
ret = 0;
out:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists