aboutsummaryrefslogtreecommitdiff
path: root/mm/huge_memory.c
diff options
context:
space:
mode:
authorAmit Pundir <amit.pundir@linaro.org>2017-08-01 10:52:52 +0530
committerAmit Pundir <amit.pundir@linaro.org>2017-08-01 11:26:49 +0530
commitb43282fc74615c71e3a58fa92a4fe62f5374acd6 (patch)
tree54c3e0f148beedd088ddb8e40268cf1c07b3bc08 /mm/huge_memory.c
parentf83fb557207250de93aa8882df19acfc7fe7ace7 (diff)
parent37f3f1536a86154b0c1cc2586fa6c513e79a440e (diff)
Merge branch 'linux-linaro-lsk-v3.18' into linux-linaro-lsk-v3.18-androidlsk-v3.18-17.08-android
Conflicts: arch/arm64/kernel/setup.c AOSP Change-Id: I98624593273ae4c90ae299f063d26f35a39a0a31 (upstream commit 12d11817eaaf "arm64: Move /proc/cpuinfo handling code") moved /proc/cpuinfo handling code from arch/arm64/kernel/{setup.c to cpuinfo.c}. Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Diffstat (limited to 'mm/huge_memory.c')
-rw-r--r--mm/huge_memory.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 8c9cbd0e4f3f..023a62bf837f 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1294,8 +1294,12 @@ int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma,
* check_same as the page may no longer be mapped.
*/
if (unlikely(pmd_trans_migrating(*pmdp))) {
+ page = pmd_page(*pmdp);
+ if (!get_page_unless_zero(page))
+ goto out_unlock;
spin_unlock(ptl);
wait_migrate_huge_page(vma->anon_vma, pmdp);
+ put_page(page);
goto out;
}
@@ -1331,8 +1335,11 @@ 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 */
if (!page_locked) {
+ if (!get_page_unless_zero(page))
+ goto out_unlock;
spin_unlock(ptl);
wait_on_page_locked(page);
+ put_page(page);
page_nid = -1;
goto out;
}