summaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2009-05-05 11:13:44 +0200
committerPekka Enberg <penberg@cs.helsinki.fi>2009-05-06 09:23:02 +0200
commit1eb5ac6466d4be7b15b38ce3ab709600f1bc891f (patch)
treef10c11cb78e8b4716fe4c98d1fa838a7cd19e9b0 /mm/slub.c
parentsparc: convert to use __HEAD and HEAD_TEXT macros. (diff)
downloadlinux-1eb5ac6466d4be7b15b38ce3ab709600f1bc891f.tar.xz
linux-1eb5ac6466d4be7b15b38ce3ab709600f1bc891f.zip
mm: SLUB fix reclaim_state
SLUB does not correctly account reclaim_state.reclaimed_slab, so it will break memory reclaim. Account it like SLAB does. Cc: stable@kernel.org 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>
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 7ab54ecbd3f3..aa34913a41ea 100644
--- 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>
@@ -1170,6 +1171,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);
}