提交 aaf1f990 编写于 作者: M Miaohe Lin 提交者: Linus Torvalds

mm/rmap: correct some obsolete comments of anon_vma

commit 2b575eb6 ("mm: convert anon_vma->lock to a mutex") changed
spinlock used to serialize access to vma list to mutex.  And further, the
commit 5a505085 ("mm/rmap: Convert the struct anon_vma::mutex to an
rwsem") converted the mutex to an rwsem for solving scalability problem.
So replace spinlock with rwsem to make comment uptodate.

Link: https://lkml.kernel.org/r/20210123072459.25903-1-linmiaohe@huawei.comSigned-off-by: NMiaohe Lin <linmiaohe@huawei.com>
Cc: Rik van Riel <riel@surriel.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 48b03eea
...@@ -168,7 +168,7 @@ static void anon_vma_chain_link(struct vm_area_struct *vma, ...@@ -168,7 +168,7 @@ static void anon_vma_chain_link(struct vm_area_struct *vma,
* *
* Anon-vma allocations are very subtle, because we may have * Anon-vma allocations are very subtle, because we may have
* optimistically looked up an anon_vma in page_lock_anon_vma_read() * optimistically looked up an anon_vma in page_lock_anon_vma_read()
* and that may actually touch the spinlock even in the newly * and that may actually touch the rwsem even in the newly
* allocated vma (it depends on RCU to make sure that the * allocated vma (it depends on RCU to make sure that the
* anon_vma isn't actually destroyed). * anon_vma isn't actually destroyed).
* *
...@@ -359,7 +359,7 @@ int anon_vma_fork(struct vm_area_struct *vma, struct vm_area_struct *pvma) ...@@ -359,7 +359,7 @@ int anon_vma_fork(struct vm_area_struct *vma, struct vm_area_struct *pvma)
goto out_error_free_anon_vma; goto out_error_free_anon_vma;
/* /*
* The root anon_vma's spinlock is the lock actually used when we * The root anon_vma's rwsem is the lock actually used when we
* lock any of the anon_vmas in this anon_vma tree. * lock any of the anon_vmas in this anon_vma tree.
*/ */
anon_vma->root = pvma->anon_vma->root; anon_vma->root = pvma->anon_vma->root;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册