Skip to contentSkip to conversation

mm/hugetlb: Fix potential missing huge page size info

PATCH Applied Miaohe Lin 2 participants 2 messages Jan 7, 2021

Subsystems (2)
lore
Share & tools
lore

Miaohe Lin

author
#0 lore raw

PATCH 1/1 mm/hugetlb: Fix potential missing huge page size info

The huge page size is encoded for VM_FAULT_HWPOISON errors only. So if we return VM_FAULT_HWPOISON, huge page size would just be ignored.

Fixes aa50d3a7aa81 ("Encode huge page size for VM_FAULT_HWPOISON errors")
---
 mm/hugetlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/hugetlb.c +1 -1
index 3ada2e78316c..e249bffa0e75 100644
@@ -4371,7 +4371,7 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm,
 		 * So we need to block hugepage fault by PG_hwpoison bit check.
 		 */
 		if (unlikely(PageHWPoison(page))) {
-			ret = VM_FAULT_HWPOISON |
+			ret = VM_FAULT_HWPOISON_LARGE |
 				VM_FAULT_SET_HINDEX(hstate_index(h));
 			goto backout_unlocked;
 		}
Signature · 1 line
2.19.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Miaohe Lin

The huge page size is encoded for VM_FAULT_HWPOISON errors only. So if we return VM_FAULT_HWPOISON, huge page size would just be ignored.

Fixes aa50d3a7aa81 ("Encode huge page size for VM_FAULT_HWPOISON errors")
---
 mm/hugetlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks!

Signature · 1 line
Mike Kravetz