linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC] remove page_table_lock in anon_vma_prepare
@ 2009-06-05 14:35 Minchan Kim
  2009-06-05 18:26 ` Hugh Dickins
  0 siblings, 1 reply; 5+ messages in thread
From: Minchan Kim @ 2009-06-05 14:35 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm, linux-kernel, Minchan Kim, Hugh Dickins, Rik van Riel,
	Nick Piggin

As I looked over the page_table_lock, it related to page table not anon_vma

I think anon_vma->lock can protect race against threads.
Do I miss something ?

If I am right, we can remove unnecessary page_table_lock holding
in anon_vma_prepare. We can get performance benefit. 

Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Rik van Riel <riel@redhat.com>
Cc: Nick Piggin <npiggin@suse.de>
---
 mm/rmap.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/mm/rmap.c b/mm/rmap.c
index b5c6e12..65b4877 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -113,14 +113,11 @@ int anon_vma_prepare(struct vm_area_struct *vma)
 		}
 		spin_lock(&anon_vma->lock);
 
-		/* page_table_lock to protect against threads */
-		spin_lock(&mm->page_table_lock);
 		if (likely(!vma->anon_vma)) {
 			vma->anon_vma = anon_vma;
 			list_add_tail(&vma->anon_vma_node, &anon_vma->head);
 			allocated = NULL;
 		}
-		spin_unlock(&mm->page_table_lock);
 
 		spin_unlock(&anon_vma->lock);
 		if (unlikely(allocated))
-- 
1.5.6.5

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-06-07 22:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-05 14:35 [RFC] remove page_table_lock in anon_vma_prepare Minchan Kim
2009-06-05 18:26 ` Hugh Dickins
2009-06-07 15:16   ` Minchan Kim
2009-06-07 16:28     ` Hugh Dickins
2009-06-07 23:50       ` Minchan Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox