Commit 1f0532eb617d28f65c93593a1491f662f14f7eac

Authored by Nick Piggin
Committed by Pekka Enberg
1 parent 1eb5ac6466

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>

Showing 1 changed file with 4 additions and 1 deletions Side-by-side Diff

... ... @@ -60,6 +60,7 @@
60 60 #include <linux/kernel.h>
61 61 #include <linux/slab.h>
62 62 #include <linux/mm.h>
  63 +#include <linux/swap.h> /* struct reclaim_state */
63 64 #include <linux/cache.h>
64 65 #include <linux/init.h>
65 66 #include <linux/module.h>
... ... @@ -255,6 +256,8 @@
255 256  
256 257 static void slob_free_pages(void *b, int order)
257 258 {
  259 + if (current->reclaim_state)
  260 + current->reclaim_state->reclaimed_slab += 1 << order;
258 261 free_pages((unsigned long)b, order);
259 262 }
260 263  
... ... @@ -407,7 +410,7 @@
407 410 spin_unlock_irqrestore(&slob_lock, flags);
408 411 clear_slob_page(sp);
409 412 free_slob_page(sp);
410   - free_page((unsigned long)b);
  413 + slob_free_pages(b, 0);
411 414 return;
412 415 }
413 416