Index: linux-2.4.21-suse2/mm/filemap.c =================================================================== --- linux-2.4.21-suse2.orig/mm/filemap.c 2005-04-04 05:58:21.000000000 -0600 +++ linux-2.4.21-suse2/mm/filemap.c 2005-04-04 06:18:57.000000000 -0600 @@ -1022,6 +1022,14 @@ */ struct page *grab_cache_page_nowait(struct address_space *mapping, unsigned long index) { + return grab_cache_page_nowait_gfp(mapping, index, mapping->gfp_mask); +} + + +struct page *grab_cache_page_nowait_gfp(struct address_space *mapping, + unsigned long index, + unsigned int gfp_mask) +{ struct page *page, **hash; hash = page_hash(mapping, index); @@ -1046,7 +1054,7 @@ } } - page = page_cache_alloc(mapping); + page = alloc_pages(gfp_mask, 0); if ( unlikely(!page) ) return NULL; /* Failed to allocate a page */ Index: linux-2.4.21-suse2/mm/page_alloc.c =================================================================== --- linux-2.4.21-suse2.orig/mm/page_alloc.c 2005-04-04 05:58:04.000000000 -0600 +++ linux-2.4.21-suse2/mm/page_alloc.c 2005-04-04 06:12:11.000000000 -0600 @@ -435,7 +435,7 @@ break; min = z->watermarks[class_idx].min; - if (!(gfp_mask & __GFP_WAIT)) + if (!(gfp_mask & __GFP_WAIT) && (gfp_mask & __GFP_HIGH)) min >>= 2; else if (current->rt_priority) min >>= 1; @@ -504,6 +504,7 @@ } out: + if (!(gfp_mask & __GFP_NOWARN)) printk(KERN_NOTICE "__alloc_pages: %u-order allocation failed (gfp=0x%x/%i)\n", order, gfp_mask, !!(current->flags & PF_MEMALLOC)); if (unlikely(vm_gfp_debug)) Index: linux-2.4.21-suse2/kernel/ksyms.c =================================================================== --- linux-2.4.21-suse2.orig/kernel/ksyms.c 2005-04-04 06:01:39.000000000 -0600 +++ linux-2.4.21-suse2/kernel/ksyms.c 2005-04-04 06:01:43.000000000 -0600 @@ -326,6 +326,7 @@ EXPORT_SYMBOL(__find_lock_page); EXPORT_SYMBOL(find_or_create_page); EXPORT_SYMBOL(grab_cache_page_nowait); +EXPORT_SYMBOL(grab_cache_page_nowait_gfp); EXPORT_SYMBOL(read_cache_page); EXPORT_SYMBOL(set_page_dirty); EXPORT_SYMBOL(vfs_readlink); Index: linux-2.4.21-suse2/include/linux/pagemap.h =================================================================== --- linux-2.4.21-suse2.orig/include/linux/pagemap.h 2003-11-10 17:44:33.000000000 -0700 +++ linux-2.4.21-suse2/include/linux/pagemap.h 2005-04-04 06:01:43.000000000 -0600 @@ -110,6 +110,7 @@ extern struct page * grab_cache_page_nowait (struct address_space *, unsigned long); +extern struct page * grab_cache_page_nowait_gfp (struct address_space *, unsigned long, unsigned int); typedef int filler_t(void *, struct page*); Index: linux-2.4.21-suse2/include/linux/mm.h =================================================================== --- linux-2.4.21-suse2.orig/include/linux/mm.h 2005-04-04 05:58:14.000000000 -0600 +++ linux-2.4.21-suse2/include/linux/mm.h 2005-04-04 06:17:10.000000000 -0600 @@ -661,6 +661,7 @@ #define __GFP_IO 0x40 /* Can start low memory physical IO? */ #define __GFP_HIGHIO 0x80 /* Can start high mem physical IO? */ #define __GFP_FS 0x100 /* Can call down to low-level FS? */ +#define __GFP_NOWARN 0x200 /* Don't warn on allocation failure */ #define GFP_NOHIGHIO (__GFP_HIGH | __GFP_WAIT | __GFP_IO) #define GFP_NOIO (__GFP_HIGH | __GFP_WAIT)