summaryrefslogtreecommitdiffstats
path: root/mm/page-writeback.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2007-10-16 23:25:48 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 08:42:45 -0700
commit69cb51d18c1ed593009d9a620cac49d0dcf15dc8 (patch)
treef26a1245b638e7421a0afd93305fd1c556867d49 /mm/page-writeback.c
parentc9e51e4180696aa67915ec5665e4ec74125565de (diff)
downloadkernel-crypto-69cb51d18c1ed593009d9a620cac49d0dcf15dc8.tar.gz
kernel-crypto-69cb51d18c1ed593009d9a620cac49d0dcf15dc8.tar.xz
kernel-crypto-69cb51d18c1ed593009d9a620cac49d0dcf15dc8.zip
mm: count writeback pages per BDI
Count per BDI writeback pages. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page-writeback.c')
-rw-r--r--mm/page-writeback.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 9b3c4ee62ab..f1d201fdcf9 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -979,14 +979,18 @@ int test_clear_page_writeback(struct page *page)
int ret;
if (mapping) {
+ struct backing_dev_info *bdi = mapping->backing_dev_info;
unsigned long flags;
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);
+ if (bdi_cap_writeback_dirty(bdi))
+ __dec_bdi_stat(bdi, BDI_WRITEBACK);
+ }
write_unlock_irqrestore(&mapping->tree_lock, flags);
} else {
ret = TestClearPageWriteback(page);
@@ -1002,14 +1006,18 @@ int test_set_page_writeback(struct page *page)
int ret;
if (mapping) {
+ struct backing_dev_info *bdi = mapping->backing_dev_info;
unsigned long flags;
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);
+ if (bdi_cap_writeback_dirty(bdi))
+ __inc_bdi_stat(bdi, BDI_WRITEBACK);
+ }
if (!PageDirty(page))
radix_tree_tag_clear(&mapping->page_tree,
page_index(page),