lkml.org 
[lkml]   [2008]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [patch 1/6] mmu_notifier: Core code
How about just taking the mmap_sem writelock in release? We have only a 
single caller of mmu_notifier_release() in mm/mmap.c and we know that we
are not holding mmap_sem at that point. So just acquire it when needed?

Index: linux-2.6/mm/mmu_notifier.c
===================================================================
--- linux-2.6.orig/mm/mmu_notifier.c 2008-01-30 11:21:57.000000000 -0800
+++ linux-2.6/mm/mmu_notifier.c 2008-01-30 11:24:59.000000000 -0800
@@ -18,6 +19,7 @@ void mmu_notifier_release(struct mm_stru
struct hlist_node *n, *t;

if (unlikely(!hlist_empty(&mm->mmu_notifier.head))) {
+ down_write(&mm->mmap_sem);
rcu_read_lock();
hlist_for_each_entry_safe_rcu(mn, n, t,
&mm->mmu_notifier.head, hlist) {
@@ -26,6 +28,7 @@ void mmu_notifier_release(struct mm_stru
mn->ops->release(mn, mm);
}
rcu_read_unlock();
+ up_write(&mm->mmap_sem);
synchronize_rcu();
}
}

\
 
 \ /
  Last update: 2008-01-30 20:31    [W:0.082 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site