Commit 99b12e3d882bc7ebdfe0de381dff3b16d21c38f7

Authored by Wu Fengguang
Committed by Linus Torvalds
1 parent 48f170fb7d

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>

Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff

... ... @@ -1141,7 +1141,6 @@
1141 1141 void account_page_writeback(struct page *page)
1142 1142 {
1143 1143 inc_zone_page_state(page, NR_WRITEBACK);
1144   - inc_zone_page_state(page, NR_WRITTEN);
1145 1144 }
1146 1145 EXPORT_SYMBOL(account_page_writeback);
1147 1146  
1148 1147  
... ... @@ -1358,8 +1357,10 @@
1358 1357 } else {
1359 1358 ret = TestClearPageWriteback(page);
1360 1359 }
1361   - if (ret)
  1360 + if (ret) {
1362 1361 dec_zone_page_state(page, NR_WRITEBACK);
  1362 + inc_zone_page_state(page, NR_WRITTEN);
  1363 + }
1363 1364 return ret;
1364 1365 }
1365 1366