From: Dafna Hirschfeld <dafna.hirschfeld@intel.com>
To: Muchun Song <muchun.song@linux.dev>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org, willy@infradead.org
Subject: Re: [PATCH] mm/hugetlb: change ENOSPC to ENOMEM in alloc_hugetlb_folio
Date: Sun, 8 Dec 2024 07:20:56 +0200 [thread overview]
Message-ID: <t24kxi5eh6ndbxafjey4p7662x4fikwzc4isdpjjxg24qma4g3@crsejjhea57f> (raw)
In-Reply-To: <BA8384B8-2A4E-434C-AD5C-DE6599D7FA3D@linux.dev>
On 02.12.2024 11:49, Muchun Song wrote:
>
>
>> On Dec 1, 2024, at 09:03, Dafna Hirschfeld <dafna.hirschfeld@intel.com> 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.
prev parent reply other threads:[~2024-12-08 5:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-01 1:03 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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=t24kxi5eh6ndbxafjey4p7662x4fikwzc4isdpjjxg24qma4g3@crsejjhea57f \
--to=dafna.hirschfeld@intel.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox