Messages in this thread Patch in this message | | | Date | Fri, 21 Oct 2022 16:36:46 +0000 | Subject | [RFC PATCH v2 30/47] hugetlb: add high-granularity check for hwpoison in fault path | From | James Houghton <> |
| |
Because hwpoison swap entries may be placed beneath the hstate-level PTE, we need to check for it separately (on top of the hstate-level PTE check that remains).
Signed-off-by: James Houghton <jthoughton@google.com> --- mm/hugetlb.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 8dba8d59ebe5..bb0005d57cab 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -6154,6 +6154,11 @@ vm_fault_t hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, mutex_unlock(&hugetlb_fault_mutex_table[hash]); migration_entry_wait_huge(vma, &hpte); return 0; + } else if (unlikely(is_hugetlb_entry_hwpoisoned(entry))) { + hugetlb_vma_unlock_read(vma); + mutex_unlock(&hugetlb_fault_mutex_table[hash]); + return VM_FAULT_HWPOISON_LARGE | + VM_FAULT_SET_HINDEX(hstate_index(h)); } /* PTE markers should be handled the same way as none pte */ -- 2.38.0.135.g90850a2211-goog
| |