From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 01573446066 for ; Tue, 25 Aug 2026 12:52:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787662344; cv=none; b=s/TPcYyD6Pe/xUGxeTmktFJp7GjyzY4+vYLT52fjo5i685a5zYHLG36Da0a42riDHdD90g5Dl/Vrzq7fmzpE+eBZ5FXLQzaPGOpwWTqK0mf3cyv22hsT+MZW4Qwyaa9rD+zMsY+8BdrxbkqOHNtES5Ys+tIoeqcz9mJnJRVBf8w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787662344; c=relaxed/simple; bh=jeePDeRUb1oF8E5ISuMrUroy5vS5x8wDsYF9T/p+cNU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WLdyoZoklPr0Rybzbw7BPDOAOPVdHq/QRiYjW3HuU/SkPLTvgfmawS0fDsxn0hoC2+yrxiyYerf9MH5w2tUE1hPVq/7rfzd4BGyhEXsAO+kOfvpzZRL8DbguMyYvEs8fw48NlEtiGIKRi7ACPVDu6ps3ZOgcKJ8JxAdtuTk9wm0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LQ5nvPxj; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LQ5nvPxj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F2401F00A3A; Tue, 25 Aug 2026 12:52:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787662339; bh=OxThQMjnWy7RIkTnG90BC8uPhJYun+rex4exdMBz3hg=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=LQ5nvPxjEUoH4UEpC+8nl9nHb7+a3spWZ1e6xJHVYG5VYUQp9ECoGZjRh0QYQAqEz QRmN5Nm/8IQRzcLqU4LyjAVB9DwnZgeuhVVgavbmtoryP8S6i08KZ6DkYIXDtvUA9B p2vF8vfnmvJBfadpy1P5t6y+27ZzOfS68O+M/jIsjQ+7Hi8Acc/qsPMOV4K7TQaT/I fB8VvYeiPpD+sCEDS33e49JgZMUJc8NGFpeVqKrQdLHlI6kBJWENW4v9zfm/dVKN92 qM4w1G10t43d9PPWmNzGVinKbB4k173ze1dCaggrxVmzddSxHgoz6c4Q7wqDqXuRBR 1FjM8KkoSdBeQ== Date: Tue, 25 Aug 2026 13:52:13 +0100 From: "Lorenzo Stoakes (ARM)" To: "David Hildenbrand (Arm)" Cc: Avi Weiss , Andrew Morton , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Soheil Hassas Yeganeh , Arjun Roy , Eric Dumazet , 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() Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 > > --- > > 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) > > -- > Cheers, > > David LGTM too so: Reviewed-by: Lorenzo Stoakes (ARM) -- Cheers, Lorenzo