writeback: fix dirtied pages accounting on redirty
authorWu Fengguang <fengguang.wu@intel.com>
Mon, 8 Aug 2011 21:22:00 +0000 (15:22 -0600)
committerWu Fengguang <fengguang.wu@intel.com>
Sun, 18 Dec 2011 06:20:23 +0000 (14:20 +0800)
commit2f800fbd777b792de54187088df19a7df0251254
tree2dc813b41da42d647468dafcf49a0b9e673df8b5
parentd3bc1fef9389e409a772ea174a5e41a6f93d9b7b
writeback: fix dirtied pages accounting on redirty

De-account the accumulative dirty counters on page redirty.

Page redirties (very common in ext4) will introduce mismatch between
counters (a) and (b)

a) NR_DIRTIED, BDI_DIRTIED, tsk->nr_dirtied
b) NR_WRITTEN, BDI_WRITTEN

This will introduce systematic errors in balanced_rate and result in
dirty page position errors (ie. the dirty pages are no longer balanced
around the global/bdi setpoints).

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>
include/linux/writeback.h
mm/page-writeback.c