linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/hugetlb: change ENOSPC to ENOMEM in alloc_hugetlb_folio
@ 2024-12-01  1:03 Dafna Hirschfeld
  2024-12-01  2:51 ` Andrew Morton
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Dafna Hirschfeld @ 2024-12-01  1:03 UTC (permalink / raw)
  To: linux-mm; +Cc: muchun.song, akpm, Dafna Hirschfeld

The error ENOSPC is translated in vmf_error to VM_FAULT_SIGBUS which is
further translated in EFAULT in i.e. pin/get_user_pages.
But when running out of pages/hugepages we expect to see ENOMEM and
not EFAULT.

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@intel.com>
---
 mm/hugetlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index cec4b121193f..5c8de0f5c760 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -3113,7 +3113,7 @@ struct folio *alloc_hugetlb_folio(struct vm_area_struct *vma,
 	if (!memcg_charge_ret)
 		mem_cgroup_cancel_charge(memcg, nr_pages);
 	mem_cgroup_put(memcg);
-	return ERR_PTR(-ENOSPC);
+	return ERR_PTR(-ENOMEM);
 }
 
 int alloc_bootmem_huge_page(struct hstate *h, int nid)
-- 
2.34.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-12-14  9:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-01  1:03 [PATCH] mm/hugetlb: change ENOSPC to ENOMEM in alloc_hugetlb_folio Dafna Hirschfeld
2024-12-01  2:51 ` Andrew Morton
2024-12-14  9:18   ` Alexander Gordeev
2024-12-01 11:49 ` Matthew Wilcox
2024-12-02  3:49 ` Muchun Song
2024-12-02  6:02   ` Dafna Hirschfeld
2024-12-02  6:06   ` Dafna Hirschfeld
2024-12-08  5:20   ` Dafna Hirschfeld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox