* [patch] pi-futex: fix mm_struct memory leak
@ 2006-06-30 18:46 Ingo Molnar
0 siblings, 0 replies; only message in thread
From: Ingo Molnar @ 2006-06-30 18:46 UTC (permalink / raw)
To: Linus Torvalds
Cc: linux-kernel, Andrew Morton, Vernon Mauery, Thomas Gleixner
From: Vernon Mauery <vernux@us.ibm.com>
Subject: pi-futex: fix mm_struct memory leak
lock_queue was getting called essentially twice in a row and was
continually incrementing the mm_count ref count, thus causing a
memory leak.
Dinakar Guniguntala provided a proper fix for the problem that simply
grabs the spinlock for the hash bucket queue rather than calling
lock_queue.
The second time we do a queue_lock in futex_lock_pi, we really only need
to take the hash bucket lock.
Signed-off-by: Dinakar Guniguntala <dino@in.ibm.com>
Signed-off-by: Vernon Mauery <vernux@us.ibm.com>
Acked-by: Paul E. McKenney <paulmck@us.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/futex.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux/kernel/futex.c
===================================================================
--- linux.orig/kernel/futex.c
+++ linux/kernel/futex.c
@@ -1208,7 +1208,7 @@ static int do_futex_lock_pi(u32 __user *
}
down_read(&curr->mm->mmap_sem);
- hb = queue_lock(&q, -1, NULL);
+ spin_lock(q.lock_ptr);
/*
* Got the lock. We might not be the anticipated owner if we
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-06-30 18:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-30 18:46 [patch] pi-futex: fix mm_struct memory leak Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox