]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
slob: fix lockup in slob_free()
authorNick Piggin <nickpiggin@yahoo.com.au>
Mon, 16 Mar 2009 10:00:28 +0000 (21:00 +1100)
committerPekka Enberg <penberg@cs.helsinki.fi>
Mon, 23 Mar 2009 08:40:45 +0000 (10:40 +0200)
Don't hold SLOB lock when freeing the page. Reduces lock hold width. See
the following thread for discussion of the bug:

  http://marc.info/?l=linux-kernel&m=123709983214143&w=2

Reported-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
mm/slob.c

index bf7e8fc3aed806542e44cc7b1d222d9e2b56dc3a..f901653707a4684fdc53904d61b53340d033ae20 100644 (file)
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -393,10 +393,11 @@ static void slob_free(void *block, int size)
                /* Go directly to page allocator. Do not pass slob allocator */
                if (slob_page_free(sp))
                        clear_slob_page_free(sp);
+               spin_unlock_irqrestore(&slob_lock, flags);
                clear_slob_page(sp);
                free_slob_page(sp);
                free_page((unsigned long)b);
-               goto out;
+               return;
        }
 
        if (!slob_page_free(sp)) {