mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
mm: mlocking in try_to_unmap_one
There's contorted mlock/munlock handling in try_to_unmap_anon() and try_to_unmap_file(), which we'd prefer not to repeat for KSM swapping. Simplify it by moving it all down into try_to_unmap_one(). One thing is then lost, try_to_munlock()'s distinction between when no vma holds the page mlocked, and when a vma does mlock it, but we could not get mmap_sem to set the page flag. But its only caller takes no interest in that distinction (and is better testing SWAP_MLOCK anyway), so let's keep the code simple and return SWAP_AGAIN for both cases. try_to_unmap_file()'s TTU_MUNLOCK nonlinear handling was particularly amusing: once unravelled, it turns out to have been choosing between two different ways of doing the same nothing. Ah, no, one way was actually returning SWAP_FAIL when it meant to return SWAP_SUCCESS. [[email protected]: comment adding to mlocking in try_to_unmap_one] [[email protected]: remove test of MLOCK_PAGES] Signed-off-by: Hugh Dickins <[email protected]> Cc: Izik Eidus <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Nick Piggin <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Lee Schermerhorn <[email protected]> Cc: Andi Kleen <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> Cc: Wu Fengguang <[email protected]> Cc: Minchan Kim <[email protected]> Signed-off-by: KOSAKI Motohiro <[email protected]> Cc: Andi Kleen <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
3ca7b3c5b6
commit
53f79acb6e
2 changed files with 32 additions and 80 deletions
|
|
@ -117,7 +117,7 @@ static void munlock_vma_page(struct page *page)
|
|||
/*
|
||||
* did try_to_unlock() succeed or punt?
|
||||
*/
|
||||
if (ret == SWAP_SUCCESS || ret == SWAP_AGAIN)
|
||||
if (ret != SWAP_MLOCK)
|
||||
count_vm_event(UNEVICTABLE_PGMUNLOCKED);
|
||||
|
||||
putback_lru_page(page);
|
||||
|
|
|
|||
Loading…
Reference in a new issue