]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
mm: add new 'read_cache_page_gfp()' helper function
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 27 Jan 2010 17:20:03 +0000 (09:20 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 9 Feb 2010 12:50:42 +0000 (04:50 -0800)
commit8268c0bce9f4df836265ac5c7982ff8f8808f199
treefa97ee0180b0cbad37da6c78d0049b27522a96be
parentb7a9d922a59d221ec2cfd15fb2fc317f2c742bdc
mm: add new 'read_cache_page_gfp()' helper function

commit 0531b2aac59c2296570ac52bfc032ef2ace7d5e1 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/linux/pagemap.h
mm/filemap.c