Thread (3 messages) 3 messages, 2 authors, 2012-03-21

Re: [PATCH V3] mm: convert rcu_read_lock() to srcu_read_lock(), thus allowing to sleep in callbacks

From: Andrea Arcangeli <hidden>
Date: 2012-03-21 18:02:30

Hi Sagi,

There are a couple of rcu_read_lock not converted at the top.

On Wed, Feb 08, 2012 at 03:55:43PM +0200, Sagi Grimberg wrote:
quoted hunk ↗ jump to hunk
@@ -196,6 +200,9 @@ static int do_mmu_notifier_register(struct mmu_notifier *mn,
 	if (unlikely(!mmu_notifier_mm))
 		goto out;
 
+	if (init_srcu_struct(&mmu_notifier_mm->srcu))
+		goto out_cleanup;
+
 	if (take_mmap_sem)
 		down_write(&mm->mmap_sem);
out_cleanup will up_write if take_mmap_sem is set, and at that point
the mmap_sem hasn't been taken yet.
quoted hunk ↗ jump to hunk
 	ret = mm_take_all_locks(mm);
@@ -226,8 +233,11 @@ static int do_mmu_notifier_register(struct mmu_notifier *mn,
 out_cleanup:
 	if (take_mmap_sem)
 		up_write(&mm->mmap_sem);
-	/* kfree() does nothing if mmu_notifier_mm is NULL */
-	kfree(mmu_notifier_mm);
+
+	if (mm->mmu_notifier_mm) {
I guess this should be "if (mmu_notifier_mm)";

I happened to notice my older patch still applies cleanly and it has
the above issues already correct, so I'm appending it after refreshing
it to upstream.

====
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help