From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
To: Zi Yan <ziy@nvidia.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Suren Baghdasaryan <surenb@google.com>,
"Liam R. Howlett" <liam@infradead.org>,
Vlastimil Babka <vbabka@kernel.org>,
Shakeel Butt <shakeel.butt@linux.dev>,
David Hildenbrand <david@kernel.org>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
Nico Pache <nico.pache@linux.dev>,
Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
Barry Song <baohua@kernel.org>,
Lance Yang <lance.yang@linux.dev>,
Usama Arif <usama.arif@linux.dev>,
Kiryl Shutsemau <kas@kernel.org>,
Mike Rapoport <rppt@kernel.org>, Michal Hocko <mhocko@suse.com>,
Xu Xin <xu.xin16@zte.com.cn>,
Chengming Zhou <chengming.zhou@linux.dev>,
Jann Horn <jannh@google.com>, Pedro Falcato <pfalcato@suse.de>,
Rik van Riel <riel@surriel.com>, Harry Yoo <harry@kernel.org>,
Chris Li <chrisl@kernel.org>, Kairui Song <kasong@tencent.com>,
Kemeng Shi <shikemeng@huaweicloud.com>,
Nhat Pham <nphamcs@gmail.com>, Baoquan He <baoquan.he@linux.dev>,
Youngjun Park <youngjun.park@lge.com>,
Peter Xu <peterx@redhat.com>,
Muchun Song <muchun.song@linux.dev>,
Oscar Salvador <osalvador@suse.de>,
Matthew Brost <matthew.brost@intel.com>,
Joshua Hahn <joshua.hahnjy@gmail.com>,
Rakie Kim <rakie.kim@sk.com>, Byungchul Park <byungchul@sk.com>,
Gregory Price <gourry@gourry.net>,
Ying Huang <ying.huang@linux.alibaba.com>,
Alistair Popple <apopple@nvidia.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/3] mm: update comments to refer to anon rmap rather than anon_vma
Date: Fri, 18 Sep 2026 14:49:27 +0100 [thread overview]
Message-ID: <aq1BACGj3wkdL530@gremlin> (raw)
In-Reply-To: <DLHVTX80IKX4.GKQ7P0C8S5IK@nvidia.com>
On Thu, Sep 17, 2026 at 04:43:15PM -0400, Zi Yan wrote:
> On Thu Sep 17, 2026 at 3:47 PM EDT, Lorenzo Stoakes (ARM) wrote:
> > Now that vma_has_anon_rmap() abstracts whether a VMA has an anonymous
> > reverse mapping, remove references to anon_vma and instead reference the
> > anon rmap.
> >
> > The anon_vma is an implementation detail and should be treated as such.
> >
> > Do not update mm/rmap.c which implements the anon_vma mechanism as it is
> > reasonable to directly reference it there.
> >
> > No functional change intended.
> >
> > Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
> > ---
> > mm/huge_memory.c | 17 +++++----
> > mm/hugetlb.c | 2 +-
> > mm/khugepaged.c | 12 +++----
> > mm/ksm.c | 6 ++--
> > mm/madvise.c | 6 ++--
> > mm/memory.c | 12 +++----
> > mm/migrate.c | 12 +++----
> > mm/mmap.c | 6 ++--
> > mm/mprotect.c | 4 +--
> > mm/mremap.c | 6 ++--
> > mm/pgtable-generic.c | 2 +-
> > mm/userfaultfd.c | 10 +++---
> > mm/vma.c | 98 ++++++++++++++++++++++++++--------------------------
> > 13 files changed, 96 insertions(+), 97 deletions(-)
> >
> > @@ -4176,11 +4176,10 @@ static int __folio_split(struct folio *folio, unsigned int new_order,
> > if (is_anon) {
> > /*
> > * The caller does not necessarily hold an mmap_lock that would
> > - * prevent the anon_vma disappearing so we first we take a
> > - * reference to it and then lock the anon_vma for write. This
> > - * is similar to folio_lock_anon_vma_read except the write lock
> > - * is taken to serialise against parallel split or collapse
> > - * operations.
> > + * prevent the anon rmap disappearing so we first we take a
>
> s/we first we/we first/
We first, we happy few, first we take a lock that we have on... ok
no. No. You're right :P
Andrew could you fix up?
>
> <snip>
>
> > @@ -1619,7 +1619,7 @@ static int try_to_merge_with_ksm_page(struct ksm_rmap_item *rmap_item,
> >
> > /*
> > * We can consider the VMA only while still holding the mmap lock,
> > - * so lock, so reference the anon_vma and calculate the linear
> > + * so lock, so reference the anon rmap and calculate the linear
>
> s/so lock,//
>
> based on the code after this comment. Please double check it. And it is
> a pre-existing typo in the comment. Hmm, it sounds very Sashiko. ;)
So Zi was sashiko all along... interesting ;)
Andrew - could you fix this up too?
>
> > * page index early, before stable_tree_append(). If anything goes
> > * wrong that prevents the rmap_item from being added to the
> > * stable_tree, break_cow() will clean it up.
>
>
> Otherwise, LGTM.
>
> Reviewed-by: Zi Yan <ziy@nvidia.com>
Thanks!
>
>
> --
> Best Regards,
> Yan, Zi
>
--
Cheers, Lorenzo
next prev parent reply other threads:[~2026-09-18 13:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 19:47 [PATCH v3 0/3] mm: implement and use vma_has_anon_rmap(), silence KCSAN Lorenzo Stoakes (ARM)
2026-09-17 19:47 ` [PATCH v3 1/3] mm/vma: const-ify vma_assert_stabilised() and associated functions Lorenzo Stoakes (ARM)
2026-09-17 20:28 ` Zi Yan
2026-09-18 10:17 ` Kiryl Shutsemau
2026-09-18 10:59 ` Pedro Falcato
2026-09-18 12:05 ` David Hildenbrand (Arm)
2026-09-20 12:20 ` Lance Yang
2026-09-17 19:47 ` [PATCH v3 2/3] mm: implement and use vma_has_anon_rmap(), silence KCSAN Lorenzo Stoakes (ARM)
2026-09-18 12:06 ` David Hildenbrand (Arm)
2026-09-20 12:25 ` Lance Yang
2026-09-17 19:47 ` [PATCH v3 3/3] mm: update comments to refer to anon rmap rather than anon_vma Lorenzo Stoakes (ARM)
2026-09-17 20:43 ` Zi Yan
2026-09-18 13:49 ` Lorenzo Stoakes (ARM) [this message]
2026-09-18 11:31 ` Pedro Falcato
2026-09-18 13:47 ` Lorenzo Stoakes (ARM)
2026-09-18 12:07 ` David Hildenbrand (Arm)
2026-09-20 12:26 ` Lance Yang
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=aq1BACGj3wkdL530@gremlin \
--to=ljs@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=baoquan.he@linux.dev \
--cc=byungchul@sk.com \
--cc=chengming.zhou@linux.dev \
--cc=chrisl@kernel.org \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=gourry@gourry.net \
--cc=harry@kernel.org \
--cc=jannh@google.com \
--cc=joshua.hahnjy@gmail.com \
--cc=kas@kernel.org \
--cc=kasong@tencent.com \
--cc=lance.yang@linux.dev \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=matthew.brost@intel.com \
--cc=mhocko@suse.com \
--cc=muchun.song@linux.dev \
--cc=nico.pache@linux.dev \
--cc=nphamcs@gmail.com \
--cc=osalvador@suse.de \
--cc=peterx@redhat.com \
--cc=pfalcato@suse.de \
--cc=rakie.kim@sk.com \
--cc=riel@surriel.com \
--cc=rppt@kernel.org \
--cc=ryan.roberts@arm.com \
--cc=shakeel.butt@linux.dev \
--cc=shikemeng@huaweicloud.com \
--cc=surenb@google.com \
--cc=usama.arif@linux.dev \
--cc=vbabka@kernel.org \
--cc=xu.xin16@zte.com.cn \
--cc=ying.huang@linux.alibaba.com \
--cc=youngjun.park@lge.com \
--cc=ziy@nvidia.com \
/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.