You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
mm: CONFIG_MMU for PG_mlocked
Remove three degrees of obfuscation, left over from when we had CONFIG_UNEVICTABLE_LRU. MLOCK_PAGES is CONFIG_HAVE_MLOCKED_PAGE_BIT is CONFIG_HAVE_MLOCK is CONFIG_MMU. rmap.o (and memory-failure.o) are only built when CONFIG_MMU, so don't need such conditions at all. Somehow, I feel no compulsion to remove the CONFIG_HAVE_MLOCK* lines from 169 defconfigs: leave those to evolve in due course. Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk> Cc: Izik Eidus <ieidus@redhat.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Nick Piggin <npiggin@suse.de> Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Rik van Riel <riel@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Wu Fengguang <fengguang.wu@intel.com> Cc: Minchan Kim <minchan.kim@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
53f79acb6e
commit
af8e3354b4
@@ -788,7 +788,7 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
|
||||
ret = SWAP_MLOCK;
|
||||
goto out_unmap;
|
||||
}
|
||||
if (MLOCK_PAGES && TTU_ACTION(flags) == TTU_MUNLOCK)
|
||||
if (TTU_ACTION(flags) == TTU_MUNLOCK)
|
||||
goto out_unmap;
|
||||
}
|
||||
if (!(flags & TTU_IGNORE_ACCESS)) {
|
||||
@@ -861,7 +861,7 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
|
||||
out_unmap:
|
||||
pte_unmap_unlock(pte, ptl);
|
||||
|
||||
if (MLOCK_PAGES && ret == SWAP_MLOCK) {
|
||||
if (ret == SWAP_MLOCK) {
|
||||
ret = SWAP_AGAIN;
|
||||
if (down_read_trylock(&vma->vm_mm->mmap_sem)) {
|
||||
if (vma->vm_flags & VM_LOCKED) {
|
||||
@@ -938,11 +938,10 @@ static int try_to_unmap_cluster(unsigned long cursor, unsigned int *mapcount,
|
||||
return ret;
|
||||
|
||||
/*
|
||||
* MLOCK_PAGES => feature is configured.
|
||||
* if we can acquire the mmap_sem for read, and vma is VM_LOCKED,
|
||||
* If we can acquire the mmap_sem for read, and vma is VM_LOCKED,
|
||||
* keep the sem while scanning the cluster for mlocking pages.
|
||||
*/
|
||||
if (MLOCK_PAGES && down_read_trylock(&vma->vm_mm->mmap_sem)) {
|
||||
if (down_read_trylock(&vma->vm_mm->mmap_sem)) {
|
||||
locked_vma = (vma->vm_flags & VM_LOCKED);
|
||||
if (!locked_vma)
|
||||
up_read(&vma->vm_mm->mmap_sem); /* don't need it */
|
||||
@@ -1075,9 +1074,6 @@ static int try_to_unmap_file(struct page *page, enum ttu_flags flags)
|
||||
|
||||
list_for_each_entry(vma, &mapping->i_mmap_nonlinear,
|
||||
shared.vm_set.list) {
|
||||
if (!MLOCK_PAGES && !(flags & TTU_IGNORE_MLOCK) &&
|
||||
(vma->vm_flags & VM_LOCKED))
|
||||
continue;
|
||||
cursor = (unsigned long) vma->vm_private_data;
|
||||
if (cursor > max_nl_cursor)
|
||||
max_nl_cursor = cursor;
|
||||
@@ -1110,9 +1106,6 @@ static int try_to_unmap_file(struct page *page, enum ttu_flags flags)
|
||||
do {
|
||||
list_for_each_entry(vma, &mapping->i_mmap_nonlinear,
|
||||
shared.vm_set.list) {
|
||||
if (!MLOCK_PAGES && !(flags & TTU_IGNORE_MLOCK) &&
|
||||
(vma->vm_flags & VM_LOCKED))
|
||||
continue;
|
||||
cursor = (unsigned long) vma->vm_private_data;
|
||||
while ( cursor < max_nl_cursor &&
|
||||
cursor < vma->vm_end - vma->vm_start) {
|
||||
|
||||
Reference in New Issue
Block a user