linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Dafna Hirschfeld <dafna.hirschfeld@intel.com>
Cc: linux-mm@kvack.org, muchun.song@linux.dev
Subject: Re: [PATCH] mm/hugetlb: change ENOSPC to ENOMEM in alloc_hugetlb_folio
Date: Sat, 30 Nov 2024 18:51:21 -0800	[thread overview]
Message-ID: <20241130185121.02da011be898052454116c4b@linux-foundation.org> (raw)
In-Reply-To: <20241201010341.1382431-1-dafna.hirschfeld@intel.com>

On Sun,  1 Dec 2024 03:03:41 +0200 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.
> 
> ...
>
> --- 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)

err, yes.  ENOSPC is for disk drives!  I'll slap a cc:stable on this
fix for a decade old bug.


  reply	other threads:[~2024-12-01  2:51 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 [this message]
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

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=20241130185121.02da011be898052454116c4b@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=dafna.hirschfeld@intel.com \
    --cc=linux-mm@kvack.org \
    --cc=muchun.song@linux.dev \
    /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