Commit 1f0532eb authored by Nick Piggin's avatar Nick Piggin Committed by Pekka Enberg

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: default avatarMatt Mackall <mpm@selenic.com>
Acked-by: default avatarChristoph Lameter <cl@linux-foundation.org>
Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
parent 1eb5ac64
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/swap.h> /* struct reclaim_state */
#include <linux/cache.h> #include <linux/cache.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -255,6 +256,8 @@ static void *slob_new_pages(gfp_t gfp, int order, int node) ...@@ -255,6 +256,8 @@ static void *slob_new_pages(gfp_t gfp, int order, int node)
static void slob_free_pages(void *b, int order) static void slob_free_pages(void *b, int order)
{ {
if (current->reclaim_state)
current->reclaim_state->reclaimed_slab += 1 << order;
free_pages((unsigned long)b, order); free_pages((unsigned long)b, order);
} }
...@@ -407,7 +410,7 @@ static void slob_free(void *block, int size) ...@@ -407,7 +410,7 @@ static void slob_free(void *block, int size)
spin_unlock_irqrestore(&slob_lock, flags); spin_unlock_irqrestore(&slob_lock, flags);
clear_slob_page(sp); clear_slob_page(sp);
free_slob_page(sp); free_slob_page(sp);
free_page((unsigned long)b); slob_free_pages(b, 0);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment