summaryrefslogtreecommitdiff
path: root/mm/fremap.c
diff options
context:
space:
mode:
authorVlastimil Babka <vbabka@suse.cz>2014-01-02 12:58:44 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-02 14:40:30 -0800
commit3b25df93c6e37e323b86a2a8c1e00c0a2821c6c9 (patch)
tree69737469efd0313ffa2b3fcbb93daf04c72a5dc6 /mm/fremap.c
parentc424be1cbbf852e46acc84d73162af3066cd2c86 (diff)
mm: munlock: fix deadlock in __munlock_pagevec()
Commit 7225522bb429 ("mm: munlock: batch non-THP page isolation and munlock+putback using pagevec" introduced __munlock_pagevec() to speed up munlock by holding lru_lock over multiple isolated pages. Pages that fail to be isolated are put_page()d immediately, also within the lock. This can lead to deadlock when __munlock_pagevec() becomes the holder of the last page pin and put_page() leads to __page_cache_release() which also locks lru_lock. The deadlock has been observed by Sasha Levin using trinity. This patch avoids the deadlock by deferring put_page() operations until lru_lock is released. Another pagevec (which is also used by later phases of the function is reused to gather the pages for put_page() operation. Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Reported-by: Sasha Levin <sasha.levin@oracle.com> Cc: Michel Lespinasse <walken@google.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Rik van Riel <riel@redhat.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Hugh Dickins <hughd@google.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/fremap.c')
0 files changed, 0 insertions, 0 deletions