Skip to contentSkip to conversation

mm/rmap: Correct obsolete comment of page_get_anon_vma()

PATCH Applied Miaohe Lin 2 participants 3 messages Feb 3, 2021 – Feb 5, 2021

Subsystems (2)
lore
Share & tools
lore

Miaohe Lin

author
#0 lore raw

PATCH 1/1 mm/rmap: Correct obsolete comment of page_get_anon_vma()

Since commit 746b18d421da ("mm: use refcounts for page_lock_anon_vma()"), page_lock_anon_vma() is renamed to page_get_anon_vma() and converted to return a refcount increased anon_vma. But it forgot to change the relevant comment.

---
 mm/rmap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/rmap.c +2 -2
index b49e85605f8f..b0fc27e77d6d 100644
@@ -462,8 +462,8 @@ void __init anon_vma_init(void)
  * Getting a lock on a stable anon_vma from a page off the LRU is tricky!
  *
  * Since there is no serialization what so ever against page_remove_rmap()
- * the best this function can do is return a locked anon_vma that might
- * have been relevant to this page.
+ * the best this function can do is return a refcount increased anon_vma
+ * that might have been relevant to this page.
  *
  * The page might have been remapped to a different anon_vma or the anon_vma
  * returned may already be freed (and even reused).
Signature · 1 line
2.19.1
#1 lore raw
Quoted 5 lines · Miaohe Lin

* Since there is no serialization what so ever against page_remove_rmap()
- * the best this function can do is return a locked anon_vma that might
- * have been relevant to this page.
+ * the best this function can do is return a refcount increased anon_vma
+ * that might have been relevant to this page.

Just s/a locked/an/
there's no need to mention again that the refcount is increased.

author
#2 lore raw

Hi:

Quoted 8 lines · Matthew Wilcox
Quoted 5 lines · Miaohe Lin

* Since there is no serialization what so ever against page_remove_rmap()
- * the best this function can do is return a locked anon_vma that might
- * have been relevant to this page.
+ * the best this function can do is return a refcount increased anon_vma
+ * that might have been relevant to this page.

Just s/a locked/an/

Many thanks for your review and reply.

Quoted 1 line

there's no need to mention again that the refcount> is increased.

I think it's ok to mention again that the refcount is increased although I didn't find out where this is first mentioned.
Thanks again.

Quoted 2 lines

.