From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <20070405174318.465278173@programming.kicks-ass.net> References: <20070405174209.498059336@programming.kicks-ass.net> Date: Thu, 05 Apr 2007 19:42:13 +0200 From: root@programming.kicks-ass.net Subject: [PATCH 04/12] mm: count writeback pages per BDI Content-Disposition: inline; filename=bdi_stat_writeback.patch Sender: owner-linux-mm@kvack.org Return-Path: To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: miklos@szeredi.hu, akpm@linux-foundation.org, neilb@suse.de, dgc@sgi.com, tomoki.sekiyama.qu@hitachi.com, a.p.zijlstra@chello.nl, nikita@clusterfs.com List-ID: Count per BDI writeback pages. Signed-off-by: Peter Zijlstra --- include/linux/backing-dev.h | 1 + mm/page-writeback.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) Index: linux-2.6/mm/page-writeback.c =================================================================== --- linux-2.6.orig/mm/page-writeback.c +++ linux-2.6/mm/page-writeback.c @@ -981,10 +981,12 @@ int test_clear_page_writeback(struct pag write_lock_irqsave(&mapping->tree_lock, flags); ret = TestClearPageWriteback(page); - if (ret) + if (ret) { radix_tree_tag_clear(&mapping->page_tree, page_index(page), PAGECACHE_TAG_WRITEBACK); + __dec_bdi_stat(mapping->backing_dev_info, BDI_WRITEBACK); + } write_unlock_irqrestore(&mapping->tree_lock, flags); } else { ret = TestClearPageWriteback(page); @@ -1004,10 +1006,12 @@ int test_set_page_writeback(struct page write_lock_irqsave(&mapping->tree_lock, flags); ret = TestSetPageWriteback(page); - if (!ret) + if (!ret) { radix_tree_tag_set(&mapping->page_tree, page_index(page), PAGECACHE_TAG_WRITEBACK); + __inc_bdi_stat(mapping->backing_dev_info, BDI_WRITEBACK); + } if (!PageDirty(page)) radix_tree_tag_clear(&mapping->page_tree, page_index(page), Index: linux-2.6/include/linux/backing-dev.h =================================================================== --- linux-2.6.orig/include/linux/backing-dev.h +++ linux-2.6/include/linux/backing-dev.h @@ -25,6 +25,7 @@ enum bdi_state { enum bdi_stat_item { BDI_DIRTY, + BDI_WRITEBACK, NR_BDI_STAT_ITEMS }; -- -- 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/ . Don't email: email@kvack.org