[RFC 6/8] Account for pages in the page cache in terms of base pages
- From: Christoph Lameter <clameter@xxxxxxx>
- Date: Thu, 19 Apr 2007 09:35:35 -0700 (PDT)
Variable Order Page Cache: Account for higher order pages
NR_FILE_PAGES now counts pages of different order. Maybe we need to
account in base page sized pages? If so then we need to change
the way we update the counters. Note that the same would have to be
done for other counters.
Signed-off-by: Christoph Lameter <clameter@xxxxxxx>
---
mm/filemap.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Index: linux-2.6.21-rc7/mm/filemap.c
===================================================================
--- linux-2.6.21-rc7.orig/mm/filemap.c 2007-04-19 09:11:13.000000000 -0700
+++ linux-2.6.21-rc7/mm/filemap.c 2007-04-19 09:14:16.000000000 -0700
@@ -119,7 +119,8 @@ void __remove_from_page_cache(struct pag
radix_tree_delete(&mapping->page_tree, page->index);
page->mapping = NULL;
mapping->nrpages--;
- __dec_zone_page_state(page, NR_FILE_PAGES);
+ __mod_zone_page_state(page_zone(page), NR_FILE_PAGES,
+ -(1 << mapping->order));
}
void remove_from_page_cache(struct page *page)
@@ -448,7 +449,8 @@ int add_to_page_cache(struct page *page,
page->mapping = mapping;
page->index = offset;
mapping->nrpages++;
- __inc_zone_page_state(page, NR_FILE_PAGES);
+ __mod_zone_page_state(page_zone(page), NR_FILE_PAGES,
+ 1 << mappig->order);
}
write_unlock_irq(&mapping->tree_lock);
radix_tree_preload_end();
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [RFC 6/8] Account for pages in the page cache in terms of base pages
- From: Nish Aravamudan
- Re: [RFC 6/8] Account for pages in the page cache in terms of base pages
- References:
- [RFC 0/8] Variable Order Page Cache
- From: Christoph Lameter
- [RFC 0/8] Variable Order Page Cache
- Prev by Date: [RFC 0/8] Variable Order Page Cache
- Next by Date: [RFC 7/8] Enhance ramfs to support higher order pages
- Previous by thread: [RFC 1/8] Add order field to address_space struct
- Next by thread: Re: [RFC 6/8] Account for pages in the page cache in terms of base pages
- Index(es):
Relevant Pages
|