aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2008-04-30 03:54:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 11:29:50 -0400
commite4ad08fe64afca4ef79ecc4c624e6e871688da0d (patch)
tree5b8b390b874700041dc0c095e8ba9ac3ed42ea77 /mm
parent76f1418b485da2707531178e517bbb5cf06b3c76 (diff)
mm: bdi: add separate writeback accounting capability
Add a new BDI capability flag: BDI_CAP_NO_ACCT_WB. If this flag is set, then don't update the per-bdi writeback stats from test_set_page_writeback() and test_clear_page_writeback(). Misc cleanups: - convert bdi_cap_writeback_dirty() and friends to static inline functions - create a flag that includes all three dirty/writeback related flags, since almst all users will want to have them toghether Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Cc: 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')
-rw-r--r--mm/page-writeback.c4
-rw-r--r--mm/shmem.c2
-rw-r--r--mm/swap_state.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 2a9942f5387..bbcb916190c 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -1246,7 +1246,7 @@ int test_clear_page_writeback(struct page *page)
1246 radix_tree_tag_clear(&mapping->page_tree, 1246 radix_tree_tag_clear(&mapping->page_tree,
1247 page_index(page), 1247 page_index(page),
1248 PAGECACHE_TAG_WRITEBACK); 1248 PAGECACHE_TAG_WRITEBACK);
1249 if (bdi_cap_writeback_dirty(bdi)) { 1249 if (bdi_cap_account_writeback(bdi)) {
1250 __dec_bdi_stat(bdi, BDI_WRITEBACK); 1250 __dec_bdi_stat(bdi, BDI_WRITEBACK);
1251 __bdi_writeout_inc(bdi); 1251 __bdi_writeout_inc(bdi);
1252 } 1252 }
@@ -1275,7 +1275,7 @@ int test_set_page_writeback(struct page *page)
1275 radix_tree_tag_set(&mapping->page_tree, 1275 radix_tree_tag_set(&mapping->page_tree,
1276 page_index(page), 1276 page_index(page),
1277 PAGECACHE_TAG_WRITEBACK); 1277 PAGECACHE_TAG_WRITEBACK);
1278 if (bdi_cap_writeback_dirty(bdi)) 1278 if (bdi_cap_account_writeback(bdi))
1279 __inc_bdi_stat(bdi, BDI_WRITEBACK); 1279 __inc_bdi_stat(bdi, BDI_WRITEBACK);
1280 } 1280 }
1281 if (!PageDirty(page)) 1281 if (!PageDirty(page))
diff --git a/mm/shmem.c b/mm/shmem.c
index e6d9298aa22..e2a6ae1a44e 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -201,7 +201,7 @@ static struct vm_operations_struct shmem_vm_ops;
201 201
202static struct backing_dev_info shmem_backing_dev_info __read_mostly = { 202static struct backing_dev_info shmem_backing_dev_info __read_mostly = {
203 .ra_pages = 0, /* No readahead */ 203 .ra_pages = 0, /* No readahead */
204 .capabilities = BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_WRITEBACK, 204 .capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK,
205 .unplug_io_fn = default_unplug_io_fn, 205 .unplug_io_fn = default_unplug_io_fn,
206}; 206};
207 207
diff --git a/mm/swap_state.c b/mm/swap_state.c
index 50757ee3f9f..d8aadaf2a0b 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -33,7 +33,7 @@ static const struct address_space_operations swap_aops = {
33}; 33};
34 34
35static struct backing_dev_info swap_backing_dev_info = { 35static struct backing_dev_info swap_backing_dev_info = {
36 .capabilities = BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_WRITEBACK, 36 .capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK,
37 .unplug_io_fn = swap_unplug_io_fn, 37 .unplug_io_fn = swap_unplug_io_fn,
38}; 38};
39 39