From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,xu.xin16@zte.com.cn,vbabka@kernel.org,surenb@google.com,si.yanteng@linux.dev,rppt@kernel.org,mhocko@suse.com,ljs@kernel.org,liam@infradead.org,dzm91@hust.edu.cn,david@kernel.org,corbet@lwn.net,chengming.zhou@linux.dev,alexs@kernel.org,lihongfu@kylinos.cn,akpm@linux-foundation.org
Subject: + ksm-update-comments-and-docs-to-reference-folio-mapping.patch added to mm-unstable branch
Date: Wed, 05 Aug 2026 09:40:51 -0700 [thread overview]
Message-ID: <20260805164051.937901F000E9@smtp.kernel.org> (raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 5887 bytes --]
The patch titled
Subject: ksm: update comments and docs to reference folio->mapping
has been added to the -mm mm-unstable branch. Its filename is
ksm-update-comments-and-docs-to-reference-folio-mapping.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/ksm-update-comments-and-docs-to-reference-folio-mapping.patch
This patch will later appear in the mm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Hongfu Li <lihongfu@kylinos.cn>
Subject: ksm: update comments and docs to reference folio->mapping
Date: Wed, 5 Aug 2026 18:59:07 +0800
The KSM code already stores and checks the stable node key via
folio->mapping, but the comment in ksm_get_folio() and the reverse mapping
documentation in ksm.rst still refer to page->mapping.
This is a pure wording update to match the folio-based implementation. No
functional change is intended.
Link: https://lore.kernel.org/20260805105927.41987-1-hongfu.li@linux.dev
Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Xu Xin <xu.xin16@zte.com.cn>
Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
Cc: Alex Shi <alexs@kernel.org>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: David Hildenbrand <david@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
Documentation/mm/ksm.rst | 4 ++--
Documentation/translations/zh_CN/mm/ksm.rst | 4 ++--
mm/ksm.c | 7 +++----
3 files changed, 7 insertions(+), 8 deletions(-)
--- a/Documentation/mm/ksm.rst~ksm-update-comments-and-docs-to-reference-folio-mapping
+++ a/Documentation/mm/ksm.rst
@@ -24,13 +24,13 @@ tree.
If a KSM page is shared between less than ``max_page_sharing`` VMAs,
the node of the stable tree that represents such KSM page points to a
-list of struct ksm_rmap_item and the ``page->mapping`` of the
+list of struct ksm_rmap_item and the ``folio->mapping`` of the
KSM page points to the stable tree node.
When the sharing passes this threshold, KSM adds a second dimension to
the stable tree. The tree node becomes a "chain" that links one or
more "dups". Each "dup" keeps reverse mapping information for a KSM
-page with ``page->mapping`` pointing to that "dup".
+page with ``folio->mapping`` pointing to that "dup".
Every "chain" and all "dups" linked into a "chain" enforce the
invariant that they represent the same write protected memory content,
--- a/Documentation/translations/zh_CN/mm/ksm.rst~ksm-update-comments-and-docs-to-reference-folio-mapping
+++ a/Documentation/translations/zh_CN/mm/ksm.rst
@@ -31,10 +31,10 @@ KSMç»´æ¤çç¨³å®æ ä¸çKSM页çéæ
å½KSM页é¢çå
±äº«æ°å°äº ``max_page_sharing`` çèæå
ååºå(VMAs)æ¶ï¼å代表äº
KSM页çç¨³å®æ å
¶ä¸çèç¹æåäºä¸ä¸ªksm_rmap_itemç»æä½ç±»åçå表ãåæ¶ï¼è¿ä¸ªKSM页
-ç ``page->mapping`` æåäºè¯¥ç¨³å®æ èç¹ã
+ç ``folio->mapping`` æåäºè¯¥ç¨³å®æ èç¹ã
妿å
±äº«æ°è¶
è¿äºéå¼ï¼KSMå°ç»ç¨³å®æ æ·»å 第äºä¸ªç»´åº¦ãç¨³å®æ å°±åæé¾æ¥ä¸ä¸ªæå¤
-ä¸ªç¨³å®æ "坿¬"ç"é¾"ãæ¯ä¸ªå¯æ¬é½ä¿çKSM页çéæ å°ä¿¡æ¯ï¼å
¶ä¸ ``page->mapping``
+ä¸ªç¨³å®æ "坿¬"ç"é¾"ãæ¯ä¸ªå¯æ¬é½ä¿çKSM页çéæ å°ä¿¡æ¯ï¼å
¶ä¸ ``folio->mapping``
æå该"坿¬"ã
æ¯ä¸ªé¾ä»¥å龿¥å°è¯¥é¾ä¸çææ"坿¬"强å¶ä¸åçæ¯ï¼å®ä»¬ä»£è¡¨äºç¸åçåä¿æ¤å
å
--- a/mm/ksm.c~ksm-update-comments-and-docs-to-reference-folio-mapping
+++ a/mm/ksm.c
@@ -959,10 +959,9 @@ enum ksm_get_folio_flags {
* seconds or even minutes: much too unresponsive. So instead we use a
* "keyhole reference": access to the ksm page from the stable node peeps
* out through its keyhole to see if that page still holds the right key,
- * pointing back to this stable node. This relies on freeing a PageAnon
- * page to reset its page->mapping to NULL, and relies on no other use of
- * a page to put something that might look like our key in page->mapping.
- * is on its way to being freed; but it is an anomaly to bear in mind.
+ * pointing back to this stable node. This relies on freeing an anon
+ * folio to reset its mapping to NULL, and relies on no other use of a
+ * folio to put something that might look like our key in its mapping.
*/
static struct folio *ksm_get_folio(struct ksm_stable_node *stable_node,
enum ksm_get_folio_flags flags)
_
Patches currently in -mm which might be from lihongfu@kylinos.cn are
selftests-mm-factor-out-hmm_buffer_alloc-to-consolidate-buffer-setup.patch
selftests-mm-fix-bug_on-checking-wrong-variable-in-mremap_dontunmap.patch
mm-swap-fix-swap_cluster_lock-config_swap-stub-signature-mismatch.patch
ksm-update-comments-and-docs-to-reference-folio-mapping.patch
mm-use-a-folio-in-the-softleaf_is_device_private-path.patch
selftests-prctl-fix-non-anonymous-vma-mapping-in-set-anon-vma-name-test.patch
reply other threads:[~2026-08-05 16:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260805164051.937901F000E9@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=alexs@kernel.org \
--cc=chengming.zhou@linux.dev \
--cc=corbet@lwn.net \
--cc=david@kernel.org \
--cc=dzm91@hust.edu.cn \
--cc=liam@infradead.org \
--cc=lihongfu@kylinos.cn \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=mm-commits@vger.kernel.org \
--cc=rppt@kernel.org \
--cc=si.yanteng@linux.dev \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
--cc=xu.xin16@zte.com.cn \
/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.