]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[PATCH] pi-futex: fix mm_struct memory leak
authorVernon Mauery <vernux@us.ibm.com>
Sat, 1 Jul 2006 11:35:42 +0000 (04:35 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sat, 1 Jul 2006 16:55:57 +0000 (09:55 -0700)
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>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/futex.c

index 6c91f938005db0719bac62a643fff9b411b7f594..22aa3c16ca73edc46242f72ad7f49ea14c8ea983 100644 (file)
@@ -1208,7 +1208,7 @@ static int do_futex_lock_pi(u32 __user *uaddr, int detect, int trylock,
        }
 
        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