Skip to contentSkip to conversation

Docs/mm: Fix a mistake for pfn in page_tables.rst

PATCH Applied Pengyu Zhang 4 participants 4 messages Oct 9, 2024 – Oct 14, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Docs/mm: Fix a mistake for pfn in page_tables.rst

The documentation incorrectly calculate the pfn value as 0x3fffff, which should be 0x3ffff instead. It is obtained by right-shifting 0xffffc000 by 14 bits.

This patch corrects the value to prevent any potential confusion for developers referencing this document.

---
 Documentation/mm/page_tables.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/mm/page_tables.rst +1 -1
index be47b192a596..e7c69cc32493 100644
@@ -29,7 +29,7 @@ address.
 With a page granularity of 4KB and a address range of 32 bits, pfn 0 is at
 address 0x00000000, pfn 1 is at address 0x00001000, pfn 2 is at 0x00002000
 and so on until we reach pfn 0xfffff at 0xfffff000. With 16KB pages pfs are
-at 0x00004000, 0x00008000 ... 0xffffc000 and pfn goes from 0 to 0x3fffff.
+at 0x00004000, 0x00008000 ... 0xffffc000 and pfn goes from 0 to 0x3ffff.
 
 As you can see, with 4KB pages the page base address uses bits 12-31 of the
 address, and this is why `PAGE_SHIFT` in this case is defined as 12 and
Signature · 1 line
2.25.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 8 lines · Pengyu Zhang

The documentation incorrectly calculate the pfn value as 0x3fffff, which should be 0x3ffff instead. It is obtained by right-shifting 0xffffc000 by 14 bits.

This patch corrects the value to prevent any potential confusion for developers referencing this document.

Thanks, I love attention to detail yet make mistakes all the time!

Yours,
Linus Walleij

maintainer Applied
#3 lore raw
In reply to Pengyu Zhang
Quoted 17 lines · Pengyu Zhang

The documentation incorrectly calculate the pfn value as 0x3fffff, which should be 0x3ffff instead. It is obtained by right-shifting 0xffffc000 by 14 bits.

This patch corrects the value to prevent any potential confusion for developers referencing this document.

---
 Documentation/mm/page_tables.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/mm/page_tables.rst +0 -0
index be47b192a596..e7c69cc32493 100644

Documentation/mm/page_tables.rst address. · line 33

Quoted 6 lines
Documentation/mm/page_tables.rst +1 -1
@@ -29,7 +29,7 @@ address.
 With a page granularity of 4KB and a address range of 32 bits, pfn 0 is at
 address 0x00000000, pfn 1 is at address 0x00001000, pfn 2 is at 0x00002000
 and so on until we reach pfn 0xfffff at 0xfffff000. With 16KB pages pfs are
-at 0x00004000, 0x00008000 ... 0xffffc000 and pfn goes from 0 to 0x3fffff.
+at 0x00004000, 0x00008000 ... 0xffffc000 and pfn goes from 0 to 0x3ffff.
 

Applied, thanks.

For future reference, when you submit an updated version of a patch, please make a note of what has changed below the "---" line. Also, you didn't pick up Mike's Reviewed-by from the first version; I've added it.

Thanks,

jon