aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
authorGravatar Wu Fengguang <fengguang.wu@intel.com> 2011-08-08 15:19:47 -0600
committerGravatar Wu Fengguang <fengguang.wu@intel.com> 2011-12-18 14:20:25 +0800
commit32c7f202a4801252a0f3578807b75a961f792870 (patch)
treec09d5578604e83c2c421aca32b6b125d70b4a2bc /fs/btrfs/file.c
parentwriteback: fix dirtied pages accounting on redirty (diff)
downloadlinux-32c7f202a4801252a0f3578807b75a961f792870.tar.gz
linux-32c7f202a4801252a0f3578807b75a961f792870.tar.bz2
linux-32c7f202a4801252a0f3578807b75a961f792870.zip
btrfs: fix dirtied pages accounting on sub-page writes
When doing 1KB sequential writes to the same page, balance_dirty_pages_ratelimited_nr() should be called once instead of 4 times, the latter makes the dirtier tasks be throttled much too heavy. Fix it with proper de-accounting on clear_page_dirty_for_io(). CC: Chris Mason <chris.mason@oracle.com> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 97fbe939c050..bfb620ead295 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1136,7 +1136,8 @@ again:
GFP_NOFS);
}
for (i = 0; i < num_pages; i++) {
- clear_page_dirty_for_io(pages[i]);
+ if (clear_page_dirty_for_io(pages[i]))
+ account_page_redirty(pages[i]);
set_page_extent_mapped(pages[i]);
WARN_ON(!PageLocked(pages[i]));
}