The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: Avi Weiss <thnkslprpt@gmail.com>,
	 Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	 Vlastimil Babka <vbabka@kernel.org>,
	Mike Rapoport <rppt@kernel.org>,
	 Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>,
	 Soheil Hassas Yeganeh <soheil@google.com>,
	Arjun Roy <arjunroy@google.com>,
	 Eric Dumazet <edumazet@google.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: return -ENOMEM for page-table allocation failure in insert_pages()
Date: Thu, 30 Jul 2026 09:36:25 +0100	[thread overview]
Message-ID: <amsM9I3at8ZE4A77@lucifer> (raw)
In-Reply-To: <2a84e37c-407b-437c-a908-56526ce86322@kernel.org>

On Thu, Jul 30, 2026 at 10:27:20AM +0200, David Hildenbrand (Arm) wrote:
> On 7/30/26 09:42, Lorenzo Stoakes (ARM) wrote:
> > On Thu, Jul 30, 2026 at 10:13:23AM +0300, Avi Weiss wrote:
> >> walk_to_pmd() returns NULL only when p4d_alloc(), pud_alloc(), or
> >> pmd_alloc() fails. These are page-table allocation failures, but
> >> insert_pages() currently reports them as -EFAULT.
> >>
> >> Return -ENOMEM instead, consistent with the subsequent pte_alloc()
> >> failure and with the single-page insert_page() path, which reports
> >> failure of the same page-table allocation chain as -ENOMEM.
> >>
> >> Address and range validation failures in vm_insert_pages() continue to
> >> return -EFAULT. Keep the later -EFAULT return for
> >> pte_offset_map_lock(), which is not an allocation failure.
> >>
> >> Fixes: 8cd3984d81d5 ("mm/memory.c: add vm_insert_pages()")
> >
> > Hmm :)
> >
> > This isn't really a fix. Anybody relying on this returning -ENOMEM
> > vs. -EFAULT here is in a state of sin anyway (unless you can point to
> > specific users who are broken).
>
> Agreed, I am missing the problem here?

Seems just a cleanup, I gave Avi some ideas ;) this function could do with
it.

>
> --
> Cheers,
>
> David

Cheers, Lorenzo

      reply	other threads:[~2026-07-30  8:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30  7:13 [PATCH] mm: return -ENOMEM for page-table allocation failure in insert_pages() Avi Weiss
2026-07-30  7:42 ` Lorenzo Stoakes (ARM)
2026-07-30  7:43   ` Lorenzo Stoakes (ARM)
2026-07-30  8:27   ` David Hildenbrand (Arm)
2026-07-30  8:36     ` Lorenzo Stoakes (ARM) [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=amsM9I3at8ZE4A77@lucifer \
    --to=ljs@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=arjunroy@google.com \
    --cc=david@kernel.org \
    --cc=edumazet@google.com \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=soheil@google.com \
    --cc=surenb@google.com \
    --cc=thnkslprpt@gmail.com \
    --cc=vbabka@kernel.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