]> Git Repo - linux.git/commit - mm/migrate.c
mm: move migrate_prep out from under mmap_sem
authorChristoph Lameter <[email protected]>
Thu, 6 Nov 2008 20:53:30 +0000 (12:53 -0800)
committerLinus Torvalds <[email protected]>
Thu, 6 Nov 2008 23:41:18 +0000 (15:41 -0800)
commit0aedadf91a70a11c4a3e7c7d99b21e5528af8d5d
tree9e2529fa79ff4134f99772b5ed3693316e2221a5
parent17a1217e12d8c8434f8a3deef7bf980c724a6ac7
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 <[email protected]>
Cc: KOSAKI Motohiro <[email protected]>
Reported-by: Heiko Carstens <[email protected]>
Cc: Nick Piggin <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Lee Schermerhorn <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/mempolicy.c
mm/migrate.c
This page took 0.051073 seconds and 4 git commands to generate.