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 v2 3/3] mm: return -ENOMEM for page-table allocation failure in insert_pages()
Date: Tue, 25 Aug 2026 13:52:13 +0100 [thread overview]
Message-ID: <ao2P4Ey3fy9MxRUJ@gremlin> (raw)
In-Reply-To: <e4a7bffe-7d23-4d7b-8ec6-5b966419c615@kernel.org>
mm/memory: please let's be consistent on all of the patches in the series.
On Tue, Aug 25, 2026 at 12:40:36PM +0200, David Hildenbrand (Arm) wrote:
> On 8/5/26 16:42, Avi Weiss wrote:
> > populate_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.
> >
> > Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
> > ---
> > mm/memory.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/mm/memory.c b/mm/memory.c
> > index 11bb4fb98761..16093479d341 100644
> > --- a/mm/memory.c
> > +++ b/mm/memory.c
> > @@ -2438,7 +2438,7 @@ static int insert_pages(struct vm_area_struct *vma, unsigned long addr,
> > more:
> > pmd = populate_to_pmd(mm, addr);
> > if (!pmd) {
> > - err = -EFAULT;
> > + err = -ENOMEM;
> > goto out;
> > }
> >
>
> For this patch:
>
> Acked-by: David Hildenbrand (Arm) <david@kernel.org>
>
> --
> Cheers,
>
> David
LGTM too so:
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
--
Cheers, Lorenzo
prev parent reply other threads:[~2026-08-25 12:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 14:42 [PATCH v2 0/3] mm: improve insert_pages() error handling Avi Weiss
2026-08-05 14:42 ` [PATCH v2 1/3] mm/memory.c: rename walk_to_pmd() to populate_to_pmd() Avi Weiss
2026-08-25 10:39 ` David Hildenbrand (Arm)
2026-08-05 14:42 ` [PATCH v2 2/3] mm/memory.c: simplify error handling in insert_pages() Avi Weiss
2026-08-25 10:38 ` David Hildenbrand (Arm)
2026-08-05 14:42 ` [PATCH v2 3/3] mm: return -ENOMEM for page-table allocation failure " Avi Weiss
2026-08-25 10:40 ` David Hildenbrand (Arm)
2026-08-25 12:52 ` 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=ao2P4Ey3fy9MxRUJ@gremlin \
--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