From: Lee Schermerhorn __mlock_vma_pages_range comment block needs updating: - it fails to mention the mlock parameter - no longer requires that mmap_sem be held for write. following patch fixes it. Signed-off-by: KOSAKI Motohiro Signed-off-by: Lee Schermerhorn Signed-off-by: Andrew Morton --- mm/mlock.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff -puN mm/mlock.c~mmap-handle-mlocked-pages-during-map-remap-unmap-mlock-fix-__mlock_vma_pages_range-comment-block mm/mlock.c --- a/mm/mlock.c~mmap-handle-mlocked-pages-during-map-remap-unmap-mlock-fix-__mlock_vma_pages_range-comment-block +++ a/mm/mlock.c @@ -112,12 +112,20 @@ static void munlock_vma_page(struct page } } -/* - * mlock a range of pages in the vma. +/** + * __mlock_vma_pages_range() - mlock/munlock a range of pages in the vma. + * @vma: target vma + * @start: start address + * @end: end address + * @mlock: 0 indicate munlock, otherwise mlock. + * + * If @mlock == 0, unlock an mlocked range; + * else mlock the range of pages. This takes care of making the pages present , + * too. * - * This takes care of making the pages present too. + * return 0 on success, negative error code on error. * - * vma->vm_mm->mmap_sem must be held for write. + * vma->vm_mm->mmap_sem must be held for at least read. */ static int __mlock_vma_pages_range(struct vm_area_struct *vma, unsigned long start, unsigned long end, _