]> Git Repo - linux.git/commit
mm: munlock: batch non-THP page isolation and munlock+putback using pagevec
authorVlastimil Babka <[email protected]>
Wed, 11 Sep 2013 21:22:29 +0000 (14:22 -0700)
committerLinus Torvalds <[email protected]>
Wed, 11 Sep 2013 22:58:00 +0000 (15:58 -0700)
commit7225522bb429a2f7dae6667e533e2d735b4882d0
treebea75219dc36159322ddcd6de8dc4a4d5e1f6c79
parent586a32ac1d33ce7a7548a27e4087e98842c3a06f
mm: munlock: batch non-THP page isolation and munlock+putback using pagevec

Currently, munlock_vma_range() calls munlock_vma_page on each page in a
loop, which results in repeated taking and releasing of the lru_lock
spinlock for isolating pages one by one.  This patch batches the munlock
operations using an on-stack pagevec, so that isolation is done under
single lru_lock.  For THP pages, the old behavior is preserved as they
might be split while putting them into the pagevec.  After this patch, a
9% speedup was measured for munlocking a 56GB large memory area with THP
disabled.

A new function __munlock_pagevec() is introduced that takes a pagevec and:
1) It clears PageMlocked and isolates all pages under lru_lock.  Zone page
stats can be also updated using the variant which assumes disabled
interrupts.  2) It finishes the munlock and lru putback on all pages under
their lock_page.  Note that previously, lock_page covered also the
PageMlocked clearing and page isolation, but it is not needed for those
operations.

Signed-off-by: Vlastimil Babka <[email protected]>
Reviewed-by: Jörn Engel <[email protected]>
Acked-by: Mel Gorman <[email protected]>
Cc: Michel Lespinasse <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/mlock.c
This page took 0.053453 seconds and 4 git commands to generate.