|
@@ -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) {
|