aboutsummaryrefslogtreecommitdiffstats
path: root/mm/rmap.c
diff options
context:
space:
mode:
authorHugh Dickins <hugh.dickins@tiscali.co.uk>2009-12-14 20:58:59 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-15 11:53:17 -0500
commitaf8e3354b4bbd1ee5a3a55d11a5e1fe37e77f0ba (patch)
tree8dc0ece80878d00409d4662c5fd1e28cd7fbbdd8 /mm/rmap.c
parent53f79acb6ecb648afd63e0f13deba167f1a934df (diff)
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>
Diffstat (limited to 'mm/rmap.c')
-rw-r--r--mm/rmap.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/mm/rmap.c b/mm/rmap.c
index c3d6dc4223a4..eb3dfc8355ea 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -788,7 +788,7 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
788 ret = SWAP_MLOCK; 788 ret = SWAP_MLOCK;
789 goto out_unmap; 789 goto out_unmap;
790 } 790 }
791 if (MLOCK_PAGES && TTU_ACTION(flags) == TTU_MUNLOCK) 791 if (TTU_ACTION(flags) == TTU_MUNLOCK)
792 goto out_unmap; 792 goto out_unmap;
793 } 793 }
794 if (!(flags & TTU_IGNORE_ACCESS)) { 794 if (!(flags & TTU_IGNORE_ACCESS)) {
@@ -861,7 +861,7 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
861out_unmap: 861out_unmap:
862 pte_unmap_unlock(pte, ptl); 862 pte_unmap_unlock(pte, ptl);
863 863
864 if (MLOCK_PAGES && ret == SWAP_MLOCK) { 864 if (ret == SWAP_MLOCK) {
865 ret = SWAP_AGAIN; 865 ret = SWAP_AGAIN;
866 if (down_read_trylock(&vma->vm_mm->mmap_sem)) { 866 if (down_read_trylock(&vma->vm_mm->mmap_sem)) {
867 if (vma->vm_flags & VM_LOCKED) { 867 if (vma->vm_flags & VM_LOCKED) {
@@ -938,11 +938,10 @@ static int try_to_unmap_cluster(unsigned long cursor, unsigned int *mapcount,
938 return ret; 938 return ret;
939 939
940 /* 940 /*
941 * MLOCK_PAGES => feature is configured. 941 * If we can acquire the mmap_sem for read, and vma is VM_LOCKED,
942 * if we can acquire the mmap_sem for read, and vma is VM_LOCKED,
943 * keep the sem while scanning the cluster for mlocking pages. 942 * keep the sem while scanning the cluster for mlocking pages.
944 */ 943 */
945 if (MLOCK_PAGES && down_read_trylock(&vma->vm_mm->mmap_sem)) { 944 if (down_read_trylock(&vma->vm_mm->mmap_sem)) {
946 locked_vma = (vma->vm_flags & VM_LOCKED); 945 locked_vma = (vma->vm_flags & VM_LOCKED);
947 if (!locked_vma) 946 if (!locked_vma)
948 up_read(&vma->vm_mm->mmap_sem); /* don't need it */ 947 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)
1075 1074
1076 list_for_each_entry(vma, &mapping->i_mmap_nonlinear, 1075 list_for_each_entry(vma, &mapping->i_mmap_nonlinear,
1077 shared.vm_set.list) { 1076 shared.vm_set.list) {
1078 if (!MLOCK_PAGES && !(flags & TTU_IGNORE_MLOCK) &&
1079 (vma->vm_flags & VM_LOCKED))
1080 continue;
1081 cursor = (unsigned long) vma->vm_private_data; 1077 cursor = (unsigned long) vma->vm_private_data;
1082 if (cursor > max_nl_cursor) 1078 if (cursor > max_nl_cursor)
1083 max_nl_cursor = cursor; 1079 max_nl_cursor = cursor;
@@ -1110,9 +1106,6 @@ static int try_to_unmap_file(struct page *page, enum ttu_flags flags)
1110 do { 1106 do {
1111 list_for_each_entry(vma, &mapping->i_mmap_nonlinear, 1107 list_for_each_entry(vma, &mapping->i_mmap_nonlinear,
1112 shared.vm_set.list) { 1108 shared.vm_set.list) {
1113 if (!MLOCK_PAGES && !(flags & TTU_IGNORE_MLOCK) &&
1114 (vma->vm_flags & VM_LOCKED))
1115 continue;
1116 cursor = (unsigned long) vma->vm_private_data; 1109 cursor = (unsigned long) vma->vm_private_data;
1117 while ( cursor < max_nl_cursor && 1110 while ( cursor < max_nl_cursor &&
1118 cursor < vma->vm_end - vma->vm_start) { 1111 cursor < vma->vm_end - vma->vm_start) {