[PATCH] kanoj-mm2.0-2.2.9 unneccesary page force in by munlock

Kanoj Sarcar
1999-05-17T04:03:03Z

While looking at the code for munlock() in mm/mlock.c, I found
that munlock() unneccesarily executes a code path that forces
page fault in over the entire range. The following patch fixes
this problem:

--- /usr/tmp/p_rdiff_a007Qs/mlock.c Sun May 16 20:48:12 1999
+++ mm/mlock.c Sun May 16 20:47:01 1999
@@ -117,8 +117,9 @@
pages = (end - start) >> PAGE_SHIFT;
if (!(newflags & VM_LOCKED))
pages = -pages;
+ else
+ make_pages_present(start, end);
vma->vm_mm->locked_vm += pages;
- make_pages_present(start, end);
}
return retval;
}

Please review and include in the source.