summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWu Fengguang <fengguang.wu@intel.com>2011-07-25 17:12:37 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-25 20:57:11 -0700
commit99b12e3d882bc7ebdfe0de381dff3b16d21c38f7 (patch)
tree2aa21f5b5a6e03e49cd7af4dbd1b38ec451b09d7
parent48f170fb7d7db8789ccc23e051af61f62af5f685 (diff)
downloadtalos-op-linux-99b12e3d882bc7ebdfe0de381dff3b16d21c38f7.tar.gz
talos-op-linux-99b12e3d882bc7ebdfe0de381dff3b16d21c38f7.zip
writeback: account NR_WRITTEN at IO completion time
NR_WRITTEN is now accounted at block IO enqueue time, which is not very accurate as to common understanding. This moves NR_WRITTEN accounting to the IO completion time and makes it more consistent with BDI_WRITTEN, which is used for bandwidth estimation. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Cc: Michael Rubin <mrubin@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/page-writeback.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 919b45eb57ad..d8767b381b9c 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -1141,7 +1141,6 @@ EXPORT_SYMBOL(account_page_dirtied);
void account_page_writeback(struct page *page)
{
inc_zone_page_state(page, NR_WRITEBACK);
- inc_zone_page_state(page, NR_WRITTEN);
}
EXPORT_SYMBOL(account_page_writeback);
@@ -1358,8 +1357,10 @@ int test_clear_page_writeback(struct page *page)
} else {
ret = TestClearPageWriteback(page);
}
- if (ret)
+ if (ret) {
dec_zone_page_state(page, NR_WRITEBACK);
+ inc_zone_page_state(page, NR_WRITTEN);
+ }
return ret;
}
OpenPOWER on IntegriCloud