From: Wu Fengguang Date: Fri, 16 Dec 2011 17:32:57 +0000 (-0500) Subject: btrfs: lower the dirty balance poll interval X-Git-Tag: v3.2-rc6~4^3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=142349f541d0bb6bc3e0d4563268105aada42b0b;p=profile%2Fcommon%2Fkernel-common.git btrfs: lower the dirty balance poll interval 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 Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index dafdfa0..52305a8 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1167,6 +1167,8 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file, 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;