All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Stoakes <ljs@kernel.org>
To: Minu Jin <s9430939@naver.com>
Cc: akpm@linux-foundation.org, david@kernel.org, liam@infradead.org,
	 vbabka@kernel.org, rppt@kernel.org, surenb@google.com,
	mhocko@suse.com,  linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: fix misleading comment for remap_pfn_range()
Date: Tue, 12 May 2026 16:46:14 +0100	[thread overview]
Message-ID: <agNK2O6G2DHtczS6@lucifer> (raw)
In-Reply-To: <20260512143543.258399-1-s9430939@naver.com>

On Tue, May 12, 2026 at 11:35:43PM +0900, Minu Jin wrote:
> The function summary describes this as remapping "kernel memory",
> but remap_pfn_range() operates on arbitrary PFNs, including
> device MMIO regions that are not kernel memory at all.
>
> Replace with "physical address range".
> It describes accurately what the function maps.
>
> Signed-off-by: Minu Jin <s9430939@naver.com>

Hm, arguably those are 'kernel' memory in some sense. And 'physical address
range' is a little confusing vs. PFN's as PFN's != physical addresses.

Also remap_pfn_range() is, in effect, a deprecated function as we move drivers
to using mmap_prepare equivalents (implemented in remap_pfn_range_prepare()) so
I'm not sure it's really worth updating?

> ---
>  mm/memory.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/memory.c b/mm/memory.c
> index ea6568571131..4e07e03a76a4 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -3172,7 +3172,7 @@ static int remap_pfn_range_prepare_vma(struct vm_area_struct *vma,
>  }
>
>  /**
> - * remap_pfn_range - remap kernel memory to userspace
> + * remap_pfn_range - remap physical address range to user space
>   * @vma: user vma to map to
>   * @addr: target page aligned user address to start at
>   * @pfn: page frame number of kernel physical memory address
> --
> 2.43.0
>

Cheers, Lorenzo


      reply	other threads:[~2026-05-12 15:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12 14:35 [PATCH] mm: fix misleading comment for remap_pfn_range() Minu Jin
2026-05-12 15:46 ` Lorenzo Stoakes [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=agNK2O6G2DHtczS6@lucifer \
    --to=ljs@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=s9430939@naver.com \
    --cc=surenb@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.