--- include/linux/pagemap.h | 16 ++++++++++------ mm/filemap.c | 19 ++++++++++++------- 2 files changed, 22 insertions(+), 13 deletions(-) Index: slub/include/linux/pagemap.h =================================================================== --- slub.orig/include/linux/pagemap.h 2007-06-04 14:52:10.000000000 -0700 +++ slub/include/linux/pagemap.h 2007-06-04 14:53:42.000000000 -0700 @@ -63,22 +63,26 @@ static inline void mapping_set_gfp_mask( void release_pages(struct page **pages, int nr, int cold); #ifdef CONFIG_NUMA -extern struct page *__page_cache_alloc(gfp_t gfp); +extern struct page *__page_cache_alloc(gfp_t gfp, + struct vm_area_struct *, unsigned long); #else -static inline struct page *__page_cache_alloc(gfp_t gfp) +static inline struct page *__page_cache_alloc(gfp_t gfp, + struct vm_area_struct *vma, unsigned long addr) { return alloc_pages(gfp, 0); } #endif -static inline struct page *page_cache_alloc(struct address_space *x) +static inline struct page *page_cache_alloc(struct address_space *x, + struct vm_area_struct *vma, unsigned long addr) { - return __page_cache_alloc(mapping_gfp_mask(x)); + return __page_cache_alloc(mapping_gfp_mask(x), vma, addr); } -static inline struct page *page_cache_alloc_cold(struct address_space *x) +static inline struct page *page_cache_alloc_cold(struct address_space *x, + struct vm_area_struct *vma, unsigned long addr) { - return __page_cache_alloc(mapping_gfp_mask(x)|__GFP_COLD); + return __page_cache_alloc(mapping_gfp_mask(x)|__GFP_COLD, vma, addr); } typedef int filler_t(void *, struct page *); Index: slub/mm/filemap.c =================================================================== --- slub.orig/mm/filemap.c 2007-06-04 14:53:48.000000000 -0700 +++ slub/mm/filemap.c 2007-06-04 14:56:13.000000000 -0700 @@ -469,12 +469,16 @@ int add_to_page_cache_lru(struct page *p } #ifdef CONFIG_NUMA -struct page *__page_cache_alloc(gfp_t gfp) +struct page *__page_cache_alloc(gfp_t gfp, + struct vm_area_struct *vma, unsigned long addr) { if (cpuset_do_page_mem_spread()) { int n = cpuset_mem_spread_node(); return alloc_pages_node(n, gfp, 0); } + if (vma) + return alloc_page_vma(gfp, vma, addr); + return alloc_pages(gfp, 0); } EXPORT_SYMBOL(__page_cache_alloc); @@ -673,7 +677,7 @@ repeat: if (!page) { if (!cached_page) { cached_page = - __page_cache_alloc(gfp_mask); + __page_cache_alloc(gfp_mask, NULL, 0); if (!cached_page) return NULL; } @@ -809,7 +813,8 @@ grab_cache_page_nowait(struct address_sp page_cache_release(page); return NULL; } - page = __page_cache_alloc(mapping_gfp_mask(mapping) & ~__GFP_FS); + page = __page_cache_alloc(mapping_gfp_mask(mapping) & ~__GFP_FS, + NULL, 0); if (page && add_to_page_cache_lru(page, mapping, index, GFP_KERNEL)) { page_cache_release(page); page = NULL; @@ -1060,7 +1065,7 @@ no_cached_page: * page.. */ if (!cached_page) { - cached_page = page_cache_alloc_cold(mapping); + cached_page = page_cache_alloc_cold(mapping, NULL, 0); if (!cached_page) { desc->error = -ENOMEM; goto out; @@ -1330,7 +1335,7 @@ static int fastcall page_cache_read(stru int ret; do { - page = page_cache_alloc_cold(mapping); + page = page_cache_alloc_cold(mapping, NULL, 0); if (!page) return -ENOMEM; @@ -1579,7 +1584,7 @@ repeat: page = find_get_page(mapping, index); if (!page) { if (!cached_page) { - cached_page = page_cache_alloc_cold(mapping); + cached_page = page_cache_alloc_cold(mapping, NULL, 0); if (!cached_page) return ERR_PTR(-ENOMEM); } @@ -1693,7 +1698,7 @@ repeat: page = find_lock_page(mapping, index); if (!page) { if (!*cached_page) { - *cached_page = page_cache_alloc(mapping); + *cached_page = page_cache_alloc(mapping, NULL, 0); if (!*cached_page) return NULL; }