]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: introduce mm_populate() for populating new vmas
authorMichel Lespinasse <walken@google.com>
Thu, 7 Feb 2013 01:26:17 +0000 (12:26 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 18 Feb 2013 05:46:20 +0000 (16:46 +1100)
commit3fe3635b6cc4bebc73593cb5cfc017469651b0ed
tree7171386dfc57b481a6e5518a919d72b2ec113b7b
parentf201b7be68a2ed85e049f39bb93e89efaba09584
mm: introduce mm_populate() for populating new vmas

When creating new mappings using the MAP_POPULATE / MAP_LOCKED flags
(or with MCL_FUTURE in effect), we want to populate the pages within the
newly created vmas. This may take a while as we may have to read pages
from disk, so ideally we want to do this outside of the write-locked
mmap_sem region.

This change introduces mm_populate(), which is used to defer populating
such mappings until after the mmap_sem write lock has been released.
This is implemented as a generalization of the former do_mlock_pages(),
which accomplished the same task but was using during mlock() / mlockall().

Signed-off-by: Michel Lespinasse <walken@google.com>
Reported-by: Andy Lutomirski <luto@amacapital.net>
Acked-by: Rik van Riel <riel@redhat.com>
Tested-by: Andy Lutomirski <luto@amacapital.net>
Cc: Greg Ungerer <gregungerer@westnet.com.au>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/aio.c
include/linux/mm.h
ipc/shm.c
mm/mlock.c
mm/mmap.c
mm/nommu.c
mm/util.c