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>
This commit is contained in:
parent
caf0801e0c
commit
0531b2aac5
2 changed files with 70 additions and 32 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue