linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "David Hildenbrand (arm)" <david@kernel.org>
To: Ingyu Jang <ingyujang25@korea.ac.kr>, linux-mm@kvack.org
Cc: akpm@linux-foundation.org
Subject: Re: [Question] Dead code in copy_pud_range() for copy_huge_pud() error check?
Date: Mon, 2 Feb 2026 16:40:54 +0100	[thread overview]
Message-ID: <f2014bf5-a4d7-489c-acf3-3a3339c030bd@kernel.org> (raw)
In-Reply-To: <20260131172854.3370590-1-ingyujang25@korea.ac.kr>

On 1/31/26 18:28, Ingyu Jang wrote:
> Hi,
> 
> I noticed that in mm/memory.c, the function copy_pud_range() checks
> if copy_huge_pud() returns -ENOMEM (at line 1421):
> 
>      err = copy_huge_pud(dst_mm, src_mm,
>                          dst_pud, src_pud, addr, src_vma);
>      if (err == -ENOMEM)
>          return -ENOMEM;
> 
> However, looking at copy_huge_pud() in mm/huge_memory.c (line 1966),
> it only returns two values:
>    - 0 on success (line 1994)
>    - -EAGAIN when !pud_trans_huge(pud) (line 1978)
> 

I think it cannot currently trigger, but likely would once we support 
PUD THP, see [1]. So best to leave it as is.


[1] https://lkml.kernel.org/r/20260202005451.774496-1-usamaarif642@gmail.com

-- 
Cheers

David


      parent reply	other threads:[~2026-02-02 15:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-31 17:28 Ingyu Jang
2026-02-02 15:28 ` Joshua Hahn
2026-02-02 15:37   ` Matthew Wilcox
2026-02-02 15:50     ` Joshua Hahn
2026-02-02 15:40 ` David Hildenbrand (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=f2014bf5-a4d7-489c-acf3-3a3339c030bd@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=ingyujang25@korea.ac.kr \
    --cc=linux-mm@kvack.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