kernel-ark/mm
Christoph Lameter 0aedadf91a mm: move migrate_prep out from under mmap_sem
Move the migrate_prep outside the mmap_sem for the following system calls

1. sys_move_pages
2. sys_migrate_pages
3. sys_mbind()

It really does not matter when we flush the lru.  The system is free to
add pages onto the lru even during migration which will make the page
migration either skip the page (mbind, migrate_pages) or return a busy
state (move_pages).

Fixes this lockdep warning (and potential deadlock):

Some VM place has
      mmap_sem -> kevent_wq via lru_add_drain_all()

net/core/dev.c::dev_ioctl()  has
     rtnl_lock  ->  mmap_sem        (*) the ioctl has copy_from_user() and it can do page fault.

linkwatch_event has
     kevent_wq -> rtnl_lock

Signed-off-by: Christoph Lameter <cl@linux-foundation.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-11-06 15:41:18 -08:00
..
allocpercpu.c
backing-dev.c
bootmem.c misc: replace __FUNCTION__ with __func__ 2008-10-16 11:21:30 -07:00
bounce.c highmem: use bio_has_data() in the bounce path 2008-10-09 08:56:01 +02:00
dmapool.c
fadvise.c Remove Andrew Morton's old email accounts 2008-10-16 11:21:32 -07:00
filemap_xip.c mm: xip/ext2 fix block allocation race 2008-08-20 15:40:32 -07:00
filemap.c fs: remove prepare_write/commit_write 2008-10-30 11:38:45 -07:00
fremap.c mmap: handle mlocked pages during map, remap, unmap 2008-10-20 08:52:31 -07:00
highmem.c
hugetlb.c hugetlb: pull gigantic page initialisation out of the default path 2008-11-06 15:41:18 -08:00
internal.h hugetlb: pull gigantic page initialisation out of the default path 2008-11-06 15:41:18 -08:00
Kconfig Unevictable LRU Infrastructure 2008-10-20 08:50:26 -07:00
maccess.c
madvise.c
Makefile memcg: allocate all page_cgroup at boot 2008-10-20 08:52:39 -07:00
memcontrol.c memcg: fix page_cgroup allocation 2008-10-23 08:55:02 -07:00
memory_hotplug.c memory hotplug: release memory regions in PAGES_PER_SECTION chunks 2008-10-20 08:52:32 -07:00
memory.c mm: remove duplicated #include's 2008-10-20 16:17:42 -07:00
mempolicy.c mm: move migrate_prep out from under mmap_sem 2008-11-06 15:41:18 -08:00
mempool.c
migrate.c mm: move migrate_prep out from under mmap_sem 2008-11-06 15:41:18 -08:00
mincore.c
mlock.c mlock: make mlock error return Posixly Correct 2008-10-20 08:52:31 -07:00
mm_init.c
mmap.c nfsd: fix vm overcommit crash 2008-10-30 11:38:47 -07:00
mmu_notifier.c
mmzone.c mm: mark the correct zone as full when scanning zonelists 2008-09-13 14:41:52 -07:00
mprotect.c
mremap.c mmap: handle mlocked pages during map, remap, unmap 2008-10-20 08:52:31 -07:00
msync.c
nommu.c nfsd: fix vm overcommit crash 2008-10-30 11:38:47 -07:00
oom_kill.c oom: do not dump task state for non thread group leaders 2008-11-06 15:41:18 -08:00
page_alloc.c hugetlb: pull gigantic page initialisation out of the default path 2008-11-06 15:41:18 -08:00
page_cgroup.c memcg: fix page_cgroup allocation 2008-10-23 08:55:02 -07:00
page_io.c
page_isolation.c memory hotplug: missing zone->lock in test_pages_isolated() 2008-10-02 15:53:13 -07:00
page-writeback.c vmscan: split LRU lists into anon & file sets 2008-10-20 08:50:25 -07:00
pagewalk.c
pdflush.c Remove Andrew Morton's old email accounts 2008-10-16 11:21:32 -07:00
prio_tree.c
quicklist.c mm: size of quicklists shouldn't be proportional to the number of CPUs 2008-09-02 19:21:38 -07:00
readahead.c vmscan: split LRU lists into anon & file sets 2008-10-20 08:50:25 -07:00
rmap.c make mm/rmap.c:anon_vma_cachep static 2008-10-20 08:52:40 -07:00
shmem_acl.c
shmem.c nfsd: fix vm overcommit crash 2008-10-30 11:38:47 -07:00
slab.c proc: move /proc/slabinfo boilerplate to mm/slub.c, mm/slab.c 2008-10-23 15:20:06 +04:00
slob.c SLOB: fix bogus ksize calculation fix 2008-10-09 12:18:27 -07:00
slub.c proc: move /proc/slabinfo boilerplate to mm/slub.c, mm/slab.c 2008-10-23 15:20:06 +04:00
sparse-vmemmap.c Christoph has moved 2008-07-04 10:40:04 -07:00
sparse.c
swap_state.c mm: pagecache insertion fewer atomics 2008-10-20 08:52:31 -07:00
swap.c swap: cull unevictable pages in fault path 2008-10-20 08:52:31 -07:00
swapfile.c mm: page lock use lock bitops 2008-10-20 08:52:32 -07:00
thrash.c
tiny-shmem.c Export tiny shmem_file_setup for DRM-GEM 2008-10-20 16:17:42 -07:00
truncate.c mmap: handle mlocked pages during map, remap, unmap 2008-10-20 08:52:31 -07:00
util.c
vmalloc.c mm: fix kernel-doc function notation 2008-10-30 11:38:46 -07:00
vmscan.c mm: unlockless reclaim 2008-10-20 08:52:32 -07:00
vmstat.c proc: move /proc/zoneinfo boilerplate to mm/vmstat.c 2008-10-23 17:35:04 +04:00