summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2009-02-18 14:48:18 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2009-02-18 15:37:54 -0800
commit1cf6e7d83bf334cc5916137862c920a97aabc018 (patch)
tree6bdbc4a98e9b332919beaeba0649797fff544795 /fs
parent610d18f4128ebbd88845d0fc60cce67b49af881e (diff)
downloadlinux-3.10-1cf6e7d83bf334cc5916137862c920a97aabc018.tar.gz
linux-3.10-1cf6e7d83bf334cc5916137862c920a97aabc018.tar.bz2
linux-3.10-1cf6e7d83bf334cc5916137862c920a97aabc018.zip
mm: task dirty accounting fix
YAMAMOTO-san noticed that task_dirty_inc doesn't seem to be called properly for cases where set_page_dirty is not used to dirty a page (eg. mark_buffer_dirty). Additionally, there is some inconsistency about when task_dirty_inc is called. It is used for dirty balancing, however it even gets called for __set_page_dirty_no_writeback. So rather than increment it in a set_page_dirty wrapper, move it down to exactly where the dirty page accounting stats are incremented. Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: Nick Piggin <npiggin@suse.de> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/buffer.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 665d446b25b..ff4d1cdd779 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -777,6 +777,7 @@ static int __set_page_dirty(struct page *page,
__inc_zone_page_state(page, NR_FILE_DIRTY);
__inc_bdi_stat(mapping->backing_dev_info,
BDI_RECLAIMABLE);
+ task_dirty_inc(current);
task_io_account_write(PAGE_CACHE_SIZE);
}
radix_tree_tag_set(&mapping->page_tree,