writeback: fix dirtied pages accounting on sub-page writes
authorWu Fengguang <fengguang.wu@intel.com>
Thu, 14 Apr 2011 13:52:37 +0000 (07:52 -0600)
committerWu Fengguang <fengguang.wu@intel.com>
Sun, 18 Dec 2011 06:20:22 +0000 (14:20 +0800)
commitd3bc1fef9389e409a772ea174a5e41a6f93d9b7b
treed1e47354263b7c930a7ec4428909693d10a10c50
parent54848d73f9f254631303d6eab9b976855988b266
writeback: fix dirtied pages accounting on sub-page writes

When dd in 512bytes, generic_perform_write() calls
balance_dirty_pages_ratelimited() 8 times for the same page, but
obviously the page is only dirtied once.

Fix it by accounting tsk->nr_dirtied and bdp_ratelimits at page dirty time.

Acked-by: Jan Kara <jack@suse.cz>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
mm/page-writeback.c