Hugh Dickins c01d5b3007 shmem: get_unmapped_area align huge page
Provide a shmem_get_unmapped_area method in file_operations, called at
mmap time to decide the mapping address.  It could be conditional on
CONFIG_TRANSPARENT_HUGEPAGE, but save #ifdefs in other places by making
it unconditional.

shmem_get_unmapped_area() first calls the usual mm->get_unmapped_area
(which we treat as a black box, highly dependent on architecture and
config and executable layout).  Lots of conditions, and in most cases it
just goes with the address that chose; but when our huge stars are
rightly aligned, yet that did not provide a suitable address, go back to
ask for a larger arena, within which to align the mapping suitably.

There have to be some direct calls to shmem_get_unmapped_area(), not via
the file_operations: because of the way shmem_zero_setup() is called to
create a shmem object late in the mmap sequence, when MAP_SHARED is
requested with MAP_ANONYMOUS or /dev/zero.  Though this only matters
when /proc/sys/vm/shmem_huge has been set.

Link: http://lkml.kernel.org/r/1466021202-61880-29-git-send-email-kirill.shutemov@linux.intel.com
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-07-26 16:19:19 -07:00
..
2016-05-31 11:52:59 -07:00
2016-07-26 16:19:19 -07:00
2016-05-31 22:17:05 +05:30
2016-07-16 06:11:59 +09:00
2016-07-15 14:19:11 +09:00
2016-05-18 16:38:59 -07:00
2016-07-16 09:53:34 +09:00
2016-04-30 13:56:46 -07:00
2016-06-15 09:51:35 +01:00
2016-07-14 12:03:50 +09:00
2016-05-29 22:32:27 -07:00
2016-05-20 18:33:37 -07:00
2016-07-06 07:25:55 -07:00
2016-04-30 14:15:56 -07:00
2016-07-26 16:19:19 -07:00
2016-05-01 14:11:12 -07:00
2016-05-31 21:25:52 -06:00
2016-05-10 01:19:26 -07:00
2016-05-23 11:18:01 -07:00