]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm: SLUB fix reclaim_state
authorNick Piggin <npiggin@suse.de>
Tue, 5 May 2009 09:13:44 +0000 (19:13 +1000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 15 Jun 2009 16:39:57 +0000 (09:39 -0700)
commit 1eb5ac6466d4be7b15b38ce3ab709600f1bc891f upstream.

SLUB does not correctly account reclaim_state.reclaimed_slab, so it will
break memory reclaim. Account it like SLAB does.

Cc: linux-mm@kvack.org
Cc: Matt Mackall <mpm@selenic.com>
Acked-by: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
mm/slub.c

index 0280eee6cf3768479760e6e564e9364d6a83e346..5663da0eb34230904fff7c9ef1137e421237789b 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -9,6 +9,7 @@
  */
 
 #include <linux/mm.h>
+#include <linux/swap.h> /* struct reclaim_state */
 #include <linux/module.h>
 #include <linux/bit_spinlock.h>
 #include <linux/interrupt.h>
@@ -1175,6 +1176,8 @@ static void __free_slab(struct kmem_cache *s, struct page *page)
 
        __ClearPageSlab(page);
        reset_page_mapcount(page);
+       if (current->reclaim_state)
+               current->reclaim_state->reclaimed_slab += pages;
        __free_pages(page, order);
 }