Commit c9e51e4180696aa67915ec5665e4ec74125565de
Committed by
Linus Torvalds
1 parent
b2e8fb6efa
Exists in
master
and in
20 other branches
mm: count reclaimable pages per BDI
Count per BDI reclaimable pages; nr_reclaimable = nr_dirty + nr_unstable. 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>
Showing 5 changed files with 16 additions and 0 deletions Side-by-side Diff
fs/buffer.c
... | ... | @@ -710,6 +710,8 @@ |
710 | 710 | |
711 | 711 | if (mapping_cap_account_dirty(mapping)) { |
712 | 712 | __inc_zone_page_state(page, NR_FILE_DIRTY); |
713 | + __inc_bdi_stat(mapping->backing_dev_info, | |
714 | + BDI_RECLAIMABLE); | |
713 | 715 | task_io_account_write(PAGE_CACHE_SIZE); |
714 | 716 | } |
715 | 717 | radix_tree_tag_set(&mapping->page_tree, |
fs/nfs/write.c
... | ... | @@ -447,6 +447,7 @@ |
447 | 447 | NFS_PAGE_TAG_COMMIT); |
448 | 448 | spin_unlock(&inode->i_lock); |
449 | 449 | inc_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); |
450 | + inc_bdi_stat(req->wb_page->mapping->backing_dev_info, BDI_RECLAIMABLE); | |
450 | 451 | __mark_inode_dirty(inode, I_DIRTY_DATASYNC); |
451 | 452 | } |
452 | 453 | |
... | ... | @@ -533,6 +534,8 @@ |
533 | 534 | while(!list_empty(head)) { |
534 | 535 | req = nfs_list_entry(head->next); |
535 | 536 | dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); |
537 | + dec_bdi_stat(req->wb_page->mapping->backing_dev_info, | |
538 | + BDI_RECLAIMABLE); | |
536 | 539 | nfs_list_remove_request(req); |
537 | 540 | clear_bit(PG_NEED_COMMIT, &(req)->wb_flags); |
538 | 541 | nfs_inode_remove_request(req); |
... | ... | @@ -1193,6 +1196,8 @@ |
1193 | 1196 | nfs_list_remove_request(req); |
1194 | 1197 | nfs_mark_request_commit(req); |
1195 | 1198 | dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); |
1199 | + dec_bdi_stat(req->wb_page->mapping->backing_dev_info, | |
1200 | + BDI_RECLAIMABLE); | |
1196 | 1201 | nfs_clear_page_tag_locked(req); |
1197 | 1202 | } |
1198 | 1203 | return -ENOMEM; |
... | ... | @@ -1218,6 +1223,8 @@ |
1218 | 1223 | nfs_list_remove_request(req); |
1219 | 1224 | clear_bit(PG_NEED_COMMIT, &(req)->wb_flags); |
1220 | 1225 | dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); |
1226 | + dec_bdi_stat(req->wb_page->mapping->backing_dev_info, | |
1227 | + BDI_RECLAIMABLE); | |
1221 | 1228 | |
1222 | 1229 | dprintk("NFS: commit (%s/%Ld %d@%Ld)", |
1223 | 1230 | req->wb_context->path.dentry->d_inode->i_sb->s_id, |
include/linux/backing-dev.h
mm/page-writeback.c
... | ... | @@ -827,6 +827,8 @@ |
827 | 827 | WARN_ON_ONCE(!PagePrivate(page) && !PageUptodate(page)); |
828 | 828 | if (mapping_cap_account_dirty(mapping)) { |
829 | 829 | __inc_zone_page_state(page, NR_FILE_DIRTY); |
830 | + __inc_bdi_stat(mapping->backing_dev_info, | |
831 | + BDI_RECLAIMABLE); | |
830 | 832 | task_io_account_write(PAGE_CACHE_SIZE); |
831 | 833 | } |
832 | 834 | radix_tree_tag_set(&mapping->page_tree, |
... | ... | @@ -961,6 +963,8 @@ |
961 | 963 | */ |
962 | 964 | if (TestClearPageDirty(page)) { |
963 | 965 | dec_zone_page_state(page, NR_FILE_DIRTY); |
966 | + dec_bdi_stat(mapping->backing_dev_info, | |
967 | + BDI_RECLAIMABLE); | |
964 | 968 | return 1; |
965 | 969 | } |
966 | 970 | return 0; |
mm/truncate.c
... | ... | @@ -72,6 +72,8 @@ |
72 | 72 | struct address_space *mapping = page->mapping; |
73 | 73 | if (mapping && mapping_cap_account_dirty(mapping)) { |
74 | 74 | dec_zone_page_state(page, NR_FILE_DIRTY); |
75 | + dec_bdi_stat(mapping->backing_dev_info, | |
76 | + BDI_RECLAIMABLE); | |
75 | 77 | if (account_size) |
76 | 78 | task_io_account_cancelled_write(account_size); |
77 | 79 | } |