diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-07-27 11:08:48 -0300 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-07-27 11:08:48 -0300 |
| commit | 40d02efad9801c1277b092c83f6471a31e77c59b (patch) | |
| tree | 5b9c22e9a945023a505bf7425ffad1802fa79a68 /mm/hugetlb.c | |
| parent | a061a8ad3f906d331020006084558e2acddc2ff7 (diff) | |
| parent | 39c3c396f8131f3db454c80e0fcfcdc54ed9ec01 (diff) | |
Merge remote-tracking branch 'torvalds/master' into perf/core
To get upstream fixes.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'mm/hugetlb.c')
| -rw-r--r-- | mm/hugetlb.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index a57e1be41401..a18c071c294e 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4788,8 +4788,13 @@ again: * sharing with another vma. */ ; - } else if (unlikely(is_hugetlb_entry_migration(entry) || - is_hugetlb_entry_hwpoisoned(entry))) { + } else if (unlikely(is_hugetlb_entry_hwpoisoned(entry))) { + bool uffd_wp = huge_pte_uffd_wp(entry); + + if (!userfaultfd_wp(dst_vma) && uffd_wp) + entry = huge_pte_clear_uffd_wp(entry); + set_huge_pte_at(dst, addr, dst_pte, entry); + } else if (unlikely(is_hugetlb_entry_migration(entry))) { swp_entry_t swp_entry = pte_to_swp_entry(entry); bool uffd_wp = huge_pte_uffd_wp(entry); @@ -5947,6 +5952,7 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, page = alloc_huge_page(dst_vma, dst_addr, 0); if (IS_ERR(page)) { + put_page(*pagep); ret = -ENOMEM; *pagep = NULL; goto out; |
