Skip to content

Commit 0976133

Browse files
Hillf Dantontorvalds
authored andcommitted
mm/migrate.c: pair unlock_page() and lock_page() when migrating huge pages
Avoid unlocking and unlocked page if we failed to lock it. Signed-off-by: Hillf Danton <dhillf@gmail.com> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 58a84aa commit 0976133

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎mm/migrate.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,9 +871,9 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,
871871

872872
if (anon_vma)
873873
put_anon_vma(anon_vma);
874-
out:
875874
unlock_page(hpage);
876875

876+
out:
877877
if (rc != -EAGAIN) {
878878
list_del(&hpage->lru);
879879
put_page(hpage);

0 commit comments

Comments
 (0)