diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-01-27 09:20:03 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-01-27 09:20:03 -0800 |
commit | 0531b2aac59c2296570ac52bfc032ef2ace7d5e1 (patch) | |
tree | 4ca454bdc03c24654529bab9c882c1cd5f99a88c /include/linux/pagemap.h | |
parent | caf0801e0cc482497c14a9ce349469c33c60beec (diff) | |
download | linux-0531b2aac59c2296570ac52bfc032ef2ace7d5e1.tar.gz linux-0531b2aac59c2296570ac52bfc032ef2ace7d5e1.tar.bz2 linux-0531b2aac59c2296570ac52bfc032ef2ace7d5e1.zip |
mm: add new 'read_cache_page_gfp()' helper function
It's a simplified 'read_cache_page()' which takes a page allocation
flag, so that different paths can control how aggressive the memory
allocations are that populate a address space.
In particular, the intel GPU object mapping code wants to be able to do
a certain amount of own internal memory management by automatically
shrinking the address space when memory starts getting tight. This
allows it to dynamically use different memory allocation policies on a
per-allocation basis, rather than depend on the (static) address space
gfp policy.
The actual new function is a one-liner, but re-organizing the helper
functions to the point where you can do this with a single line of code
is what most of the patch is all about.
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/pagemap.h')
-rw-r--r-- | include/linux/pagemap.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index ed5d7501e181..3c62ed408492 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -253,6 +253,8 @@ extern struct page * read_cache_page_async(struct address_space *mapping, extern struct page * read_cache_page(struct address_space *mapping, pgoff_t index, filler_t *filler, void *data); +extern struct page * read_cache_page_gfp(struct address_space *mapping, + pgoff_t index, gfp_t gfp_mask); extern int read_cache_pages(struct address_space *mapping, struct list_head *pages, filler_t *filler, void *data); |