aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2009-05-05 05:13:45 -0400
committerPekka Enberg <penberg@cs.helsinki.fi>2009-05-06 03:23:17 -0400
commit1f0532eb617d28f65c93593a1491f662f14f7eac (patch)
tree6023123bae2ed717b35c1c70be0de692e439bf80 /mm
parent1eb5ac6466d4be7b15b38ce3ab709600f1bc891f (diff)
mm: SLOB fix reclaim_state
SLOB 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 Acked-by: 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')
-rw-r--r--mm/slob.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/slob.c b/mm/slob.c
index a2d4ab32198d..f92e66d558bd 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -60,6 +60,7 @@
60#include <linux/kernel.h> 60#include <linux/kernel.h>
61#include <linux/slab.h> 61#include <linux/slab.h>
62#include <linux/mm.h> 62#include <linux/mm.h>
63#include <linux/swap.h> /* struct reclaim_state */
63#include <linux/cache.h> 64#include <linux/cache.h>
64#include <linux/init.h> 65#include <linux/init.h>
65#include <linux/module.h> 66#include <linux/module.h>
@@ -255,6 +256,8 @@ static void *slob_new_pages(gfp_t gfp, int order, int node)
255 256
256static void slob_free_pages(void *b, int order) 257static void slob_free_pages(void *b, int order)
257{ 258{
259 if (current->reclaim_state)
260 current->reclaim_state->reclaimed_slab += 1 << order;
258 free_pages((unsigned long)b, order); 261 free_pages((unsigned long)b, order);
259} 262}
260 263
@@ -407,7 +410,7 @@ static void slob_free(void *block, int size)
407 spin_unlock_irqrestore(&slob_lock, flags); 410 spin_unlock_irqrestore(&slob_lock, flags);
408 clear_slob_page(sp); 411 clear_slob_page(sp);
409 free_slob_page(sp); 412 free_slob_page(sp);
410 free_page((unsigned long)b); 413 slob_free_pages(b, 0);
411 return; 414 return;
412 } 415 }
413 416