提交 a99e4e41 编写于 作者: V Vernon Mauery 提交者: Linus Torvalds

[PATCH] 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: NDinakar Guniguntala <dino@in.ibm.com>
Signed-off-by: NVernon Mauery <vernux@us.ibm.com>
Acked-by: NPaul E. McKenney <paulmck@us.ibm.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 9262e914
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册