From: Pengyu Zhang <zpenya1314@gmail.com>
To: alexs@kernel.org, siyanteng@loongson.cn, corbet@lwn.net,
seakeel@gmail.com, si.yanteng@linux.dev
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
yaxin_wang_uestc@163.com, zenghui.yu@linux.dev,
Pengyu Zhang <zpenya1314@gmail.com>,
Mike Rapoport <rppt@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>
Subject: [PATCH v6 2/4] Docs/mm: Fix a mistake for pfn in page_tables.rst
Date: Wed, 16 Oct 2024 22:17:59 +0800 [thread overview]
Message-ID: <20241016141801.25487-3-zpenya1314@gmail.com> (raw)
In-Reply-To: <20241016141801.25487-1-zpenya1314@gmail.com>
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.
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Zenghui Yu <zenghui.yu@linux.dev>
Reviewed-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Pengyu Zhang <zpenya1314@gmail.com>
---
v5->v6:no changed
Documentation/mm/page_tables.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/mm/page_tables.rst b/Documentation/mm/page_tables.rst
index be47b192a596..e7c69cc32493 100644
--- a/Documentation/mm/page_tables.rst
+++ b/Documentation/mm/page_tables.rst
@@ -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
--
2.25.1
next prev parent reply other threads:[~2024-10-16 14:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-16 14:17 [PATCH v6 0/4] translate page_tables.rst and fix PFN calculation Pengyu Zhang
2024-10-16 14:17 ` [PATCH v6 1/4] Docs/zh_CN: Translate page_tables.rst to Simplified Chinese Pengyu Zhang
2024-10-17 2:23 ` Yanteng Si
2024-10-16 14:17 ` Pengyu Zhang [this message]
2024-10-17 14:55 ` [PATCH v6 2/4] Docs/mm: Fix a mistake for pfn in page_tables.rst Jonathan Corbet
2024-10-16 14:18 ` [PATCH v6 3/4] Docs/zh_CN: Fix the pfn calculation error " Pengyu Zhang
2024-10-16 14:18 ` [PATCH v6 4/4] docs/zh_CN: Add a entry in Chinese glossary Pengyu Zhang
2024-10-17 2:24 ` Yanteng Si
2024-10-21 15:48 ` [PATCH v6 0/4] translate page_tables.rst and fix PFN calculation Jonathan Corbet
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=20241016141801.25487-3-zpenya1314@gmail.com \
--to=zpenya1314@gmail.com \
--cc=alexs@kernel.org \
--cc=corbet@lwn.net \
--cc=linus.walleij@linaro.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rppt@kernel.org \
--cc=seakeel@gmail.com \
--cc=si.yanteng@linux.dev \
--cc=siyanteng@loongson.cn \
--cc=yaxin_wang_uestc@163.com \
--cc=zenghui.yu@linux.dev \
/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
all inboxes | Powered by JetHome®