Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: fix misleading comment for remap_pfn_range()
@ 2026-05-12 14:35 Minu Jin
  2026-05-12 15:46 ` Lorenzo Stoakes
  0 siblings, 1 reply; 2+ messages in thread
From: Minu Jin @ 2026-05-12 14:35 UTC (permalink / raw)
  To: akpm, david
  Cc: ljs, liam, vbabka, rppt, surenb, mhocko, linux-mm, linux-kernel,
	Minu Jin

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>
---
 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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm: fix misleading comment for remap_pfn_range()
  2026-05-12 14:35 [PATCH] mm: fix misleading comment for remap_pfn_range() Minu Jin
@ 2026-05-12 15:46 ` Lorenzo Stoakes
  0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Stoakes @ 2026-05-12 15:46 UTC (permalink / raw)
  To: Minu Jin
  Cc: akpm, david, liam, vbabka, rppt, surenb, mhocko, linux-mm,
	linux-kernel

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-12 15:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-12 14:35 [PATCH] mm: fix misleading comment for remap_pfn_range() Minu Jin
2026-05-12 15:46 ` Lorenzo Stoakes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox