aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorMichael Rubin <mrubin@google.com>2010-10-26 17:21:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-26 19:52:06 -0400
commitea941f0e2a8c02ae876cd73deb4e1557248f258c (patch)
treed2006c10cce4f134dc83f7f5aaa1d0096902cc1a /mm
parentf629d1c9bd0dbc44a6c4f9a4a67d1646c42bfc6f (diff)
writeback: add nr_dirtied and nr_written to /proc/vmstat
To help developers and applications gain visibility into writeback behaviour adding two entries to vm_stat_items and /proc/vmstat. This will allow us to track the "written" and "dirtied" counts. # grep nr_dirtied /proc/vmstat nr_dirtied 3747 # grep nr_written /proc/vmstat nr_written 3618 Signed-off-by: Michael Rubin <mrubin@google.com> Reviewed-by: Wu Fengguang <fengguang.wu@intel.com> Cc: Dave Chinner <david@fromorbit.com> Cc: Jens Axboe <axboe@kernel.dk> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/page-writeback.c2
-rw-r--r--mm/vmstat.c3
2 files changed, 5 insertions, 0 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 94159819a65..4dd91f7fd39 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -1121,6 +1121,7 @@ void account_page_dirtied(struct page *page, struct address_space *mapping)
1121{ 1121{
1122 if (mapping_cap_account_dirty(mapping)) { 1122 if (mapping_cap_account_dirty(mapping)) {
1123 __inc_zone_page_state(page, NR_FILE_DIRTY); 1123 __inc_zone_page_state(page, NR_FILE_DIRTY);
1124 __inc_zone_page_state(page, NR_DIRTIED);
1124 __inc_bdi_stat(mapping->backing_dev_info, BDI_RECLAIMABLE); 1125 __inc_bdi_stat(mapping->backing_dev_info, BDI_RECLAIMABLE);
1125 task_dirty_inc(current); 1126 task_dirty_inc(current);
1126 task_io_account_write(PAGE_CACHE_SIZE); 1127 task_io_account_write(PAGE_CACHE_SIZE);
@@ -1136,6 +1137,7 @@ EXPORT_SYMBOL(account_page_dirtied);
1136void account_page_writeback(struct page *page) 1137void account_page_writeback(struct page *page)
1137{ 1138{
1138 inc_zone_page_state(page, NR_WRITEBACK); 1139 inc_zone_page_state(page, NR_WRITEBACK);
1140 inc_zone_page_state(page, NR_WRITTEN);
1139} 1141}
1140EXPORT_SYMBOL(account_page_writeback); 1142EXPORT_SYMBOL(account_page_writeback);
1141 1143
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 355a9e669aa..44e7ac0fdb6 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -745,6 +745,9 @@ static const char * const vmstat_text[] = {
745 "nr_isolated_anon", 745 "nr_isolated_anon",
746 "nr_isolated_file", 746 "nr_isolated_file",
747 "nr_shmem", 747 "nr_shmem",
748 "nr_dirtied",
749 "nr_written",
750
748#ifdef CONFIG_NUMA 751#ifdef CONFIG_NUMA
749 "numa_hit", 752 "numa_hit",
750 "numa_miss", 753 "numa_miss",