From: Wei Yang <richard.weiyang@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, Wei Yang <richard.weiyang@gmail.com>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
Jann Horn <jannh@google.com>, Vlastimil Babka <vbabka@suse.cz>,
Michel Lespinasse <michel@lespinasse.org>
Subject: [PATCH] mm/vma: correct legacy comment in vm_[un]lock_anon_vma()
Date: Tue, 1 Apr 2025 09:43:46 +0000 [thread overview]
Message-ID: <20250401094346.25200-1-richard.weiyang@gmail.com> (raw)
In commit bf181b9f9d8d ("mm anon rmap: replace same_anon_vma linked
list with an interval tree."), the anon_vma.same_anon_vma is replaced by
interval tree.
But the related comment is left behind. Correct it here.
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Jann Horn <jannh@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Michel Lespinasse <michel@lespinasse.org>
---
mm/vma.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/mm/vma.c b/mm/vma.c
index 5cdc5612bfc1..1a155031f1fb 100644
--- a/mm/vma.c
+++ b/mm/vma.c
@@ -1989,16 +1989,16 @@ static void vm_lock_anon_vma(struct mm_struct *mm, struct anon_vma *anon_vma)
{
if (!test_bit(0, (unsigned long *) &anon_vma->root->rb_root.rb_root.rb_node)) {
/*
- * The LSB of head.next can't change from under us
+ * The LSB of rb_root.rb_node can't change from under us
* because we hold the mm_all_locks_mutex.
*/
down_write_nest_lock(&anon_vma->root->rwsem, &mm->mmap_lock);
/*
- * We can safely modify head.next after taking the
+ * We can safely modify rb_root.rb_node after taking the
* anon_vma->root->rwsem. If some other vma in this mm shares
* the same anon_vma we won't take it again.
*
- * No need of atomic instructions here, head.next
+ * No need of atomic instructions here, rb_root.rb_node
* can't change from under us thanks to the
* anon_vma->root->rwsem.
*/
@@ -2124,14 +2124,14 @@ static void vm_unlock_anon_vma(struct anon_vma *anon_vma)
{
if (test_bit(0, (unsigned long *) &anon_vma->root->rb_root.rb_root.rb_node)) {
/*
- * The LSB of head.next can't change to 0 from under
+ * The LSB of rb_root.rb_node can't change to 0 from under
* us because we hold the mm_all_locks_mutex.
*
* We must however clear the bitflag before unlocking
* the vma so the users using the anon_vma->rb_root will
* never see our bitflag.
*
- * No need of atomic instructions here, head.next
+ * No need of atomic instructions here, rb_root.rb_node
* can't change from under us until we release the
* anon_vma->root->rwsem.
*/
--
2.34.1
next reply other threads:[~2025-04-01 9:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-01 9:43 Wei Yang [this message]
2025-04-01 9:55 ` Lorenzo Stoakes
2025-04-01 11:46 ` Wei Yang
2025-04-01 12:11 ` Lorenzo Stoakes
2025-04-01 23:37 ` Wei 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=20250401094346.25200-1-richard.weiyang@gmail.com \
--to=richard.weiyang@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=jannh@google.com \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=michel@lespinasse.org \
--cc=vbabka@suse.cz \
/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