Re: [PATCH] mm/hugetlb: change ENOSPC to ENOMEM in alloc_hugetlb_folio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02.12.2024 11:49, Muchun Song wrote:


On Dec 1, 2024, at 09:03, Dafna Hirschfeld <dafna.hirschfeld@xxxxxxxxx> wrote:

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.

Hi Dafna,

Refers to Documentation/mm/hugetlbfs_reserv.rst. I saw:

   If no huge page exists at page fault time, the task is sent
   a **SIGBUS** and often dies an unhappy death.

Seems SIGBUS is expected since it is introduced.

Hi,
I see that mlock do return ENOMEM when out of hugepages.
It has the function "__mlock_posix_error_return" that converts EFAULT returned from
"get_user_pages" to ENOMEM.
So callers to "get_user_pages" can override EFAULT with ENOMEM but then it obscure
cases where EFUALT should really be the return code.

thanks,
Dafna


Thanks.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux