diff --git a/mm/rmap.c b/mm/rmap.c index 0e83c3be8568afaed6040c1f413d66cd8a79130e..1235368f06282a3061cfaf90eca4b87df6fae58a 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1990,14 +1990,13 @@ static bool page_mlock_one(struct page *page, struct vm_area_struct *vma, * this function is never called when PageDoubleMap(). */ mlock_vma_page(page); + /* + * No need to scan further once the page is marked + * as mlocked. + */ page_vma_mapped_walk_done(&pvmw); + return false; } - - /* - * no need to continue scanning other vma's if the page has - * been locked. - */ - return false; } return true;