Commit 4dcbc8fe authored by Chas Williams's avatar Chas Williams Committed by Kleber Sacilotto de Souza

Fixes: Commit cdbf9267 ("mm: numa: avoid waiting on freed migrated pages")

BugLink: https://bugs.launchpad.net/bugs/1797563

Commit cdbf9267 ("mm: numa: avoid waiting on freed migrated pages")
was an incomplete backport of the upstream commit.  It is necessary to
always reset page_nid before attempting any early exit.

The original commit conflicted due to lack of commit 82b0f8c3
("mm: join struct fault_env and vm_fault") in 4.9 so it wasn't a clean
application, and the change must have just gotten lost in the noise.
Signed-off-by: default avatarChas Williams <chas3@att.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 9f7bc45f
...@@ -1393,12 +1393,12 @@ int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, ...@@ -1393,12 +1393,12 @@ int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma,
/* Migration could have started since the pmd_trans_migrating check */ /* Migration could have started since the pmd_trans_migrating check */
if (!page_locked) { if (!page_locked) {
page_nid = -1;
if (!get_page_unless_zero(page)) if (!get_page_unless_zero(page))
goto out_unlock; goto out_unlock;
spin_unlock(ptl); spin_unlock(ptl);
wait_on_page_locked(page); wait_on_page_locked(page);
put_page(page); put_page(page);
page_nid = -1;
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment