Commit 1eb5ac6466d4be7b15b38ce3ab709600f1bc891f
Committed by
Pekka Enberg
1 parent
ce8a7424d2
Exists in
master
and in
7 other branches
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>
Showing 1 changed file with 3 additions and 0 deletions Side-by-side Diff
mm/slub.c
... | ... | @@ -9,6 +9,7 @@ |
9 | 9 | */ |
10 | 10 | |
11 | 11 | #include <linux/mm.h> |
12 | +#include <linux/swap.h> /* struct reclaim_state */ | |
12 | 13 | #include <linux/module.h> |
13 | 14 | #include <linux/bit_spinlock.h> |
14 | 15 | #include <linux/interrupt.h> |
... | ... | @@ -1170,6 +1171,8 @@ |
1170 | 1171 | |
1171 | 1172 | __ClearPageSlab(page); |
1172 | 1173 | reset_page_mapcount(page); |
1174 | + if (current->reclaim_state) | |
1175 | + current->reclaim_state->reclaimed_slab += pages; | |
1173 | 1176 | __free_pages(page, order); |
1174 | 1177 | } |
1175 | 1178 |