Skip to content

Commit

Permalink
slob: fix lockup in slob_free()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nick Piggin authored and Pekka Enberg committed Mar 23, 2009
1 parent b578f3f commit 6fb8f42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mm/slob.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 6fb8f42

Please sign in to comment.