diff options
author | Wu Fengguang <fengguang.wu@intel.com> | 2011-08-08 17:19:47 -0400 |
---|---|---|
committer | Wu Fengguang <fengguang.wu@intel.com> | 2011-12-18 01:20:25 -0500 |
commit | 32c7f202a4801252a0f3578807b75a961f792870 (patch) | |
tree | c09d5578604e83c2c421aca32b6b125d70b4a2bc /fs | |
parent | 2f800fbd777b792de54187088df19a7df0251254 (diff) |
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')
-rw-r--r-- | fs/btrfs/file.c | 3 |
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: | |||
1136 | GFP_NOFS); | 1136 | GFP_NOFS); |
1137 | } | 1137 | } |
1138 | for (i = 0; i < num_pages; i++) { | 1138 | for (i = 0; i < num_pages; i++) { |
1139 | clear_page_dirty_for_io(pages[i]); | 1139 | if (clear_page_dirty_for_io(pages[i])) |
1140 | account_page_redirty(pages[i]); | ||
1140 | set_page_extent_mapped(pages[i]); | 1141 | set_page_extent_mapped(pages[i]); |
1141 | WARN_ON(!PageLocked(pages[i])); | 1142 | WARN_ON(!PageLocked(pages[i])); |
1142 | } | 1143 | } |