[PATCH] btrfs: lower the dirty balance poll interval

From: Wu Fengguang
Date: Thu Nov 17 2011 - 07:24:09 EST


Tests show that the original large intervals can easily make the dirty
limit exceeded on 100 concurrent dd's. So adapt to as large as the
next check point selected by the dirty throttling algorithm.

Signed-off-by: Wu Fengguang <fengguang.wu@xxxxxxxxx>
---
fs/btrfs/file.c | 2 ++
1 file changed, 2 insertions(+)

--- linux-next.orig/fs/btrfs/file.c 2011-11-17 20:18:51.000000000 +0800
+++ linux-next/fs/btrfs/file.c 2011-11-17 20:18:55.000000000 +0800
@@ -1168,6 +1168,8 @@ static noinline ssize_t __btrfs_buffered
nrptrs = min((iov_iter_count(i) + PAGE_CACHE_SIZE - 1) /
PAGE_CACHE_SIZE, PAGE_CACHE_SIZE /
(sizeof(struct page *)));
+ nrptrs = min(nrptrs, current->nr_dirtied_pause - current->nr_dirtied);
+ nrptrs = max(nrptrs, 8);
pages = kmalloc(nrptrs * sizeof(struct page *), GFP_KERNEL);
if (!pages)
return -ENOMEM;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/