linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: account NR_WRITTEN at IO completion time
@ 2011-07-13 22:24 Wu Fengguang
  0 siblings, 0 replies; only message in thread
From: Wu Fengguang @ 2011-07-13 22:24 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Michael Rubin, Linux Memory Management List, LKML

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.

CC: Michael Rubin <mrubin@google.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
 mm/page-writeback.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- linux-next.orig/mm/page-writeback.c	2011-04-18 17:28:44.000000000 +0800
+++ linux-next/mm/page-writeback.c	2011-04-18 17:30:33.000000000 +0800
@@ -1846,7 +1846,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);
 
@@ -2063,8 +2062,10 @@ int test_clear_page_writeback(struct pag
 	} else {
 		ret = TestClearPageWriteback(page);
 	}
-	if (ret)
+	if (ret) {
 		dec_zone_page_state(page, NR_WRITEBACK);
+		inc_zone_page_state(page, NR_WRITTEN);
+	}
 	return ret;
 }
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-07-13 22:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-13 22:24 [PATCH] mm: account NR_WRITTEN at IO completion time Wu Fengguang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).