From 5cf44db7b30dae40b11c3dcbaead81fa145c7fe8 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Wed, 26 Mar 2008 12:46:34 -0700 Subject: slub: Move map/flag clearing to __free_slab __free_slab does some diagnostics. The resetting of mapcount etc in discard_slab() can interfere with debug processing. So move the reset immediately before the page is freed. Signed-off-by: Christoph Lameter --- mm/slub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: linux-2.6/mm/slub.c =================================================================== --- linux-2.6.orig/mm/slub.c 2008-04-04 12:56:39.000000000 -0700 +++ linux-2.6/mm/slub.c 2008-04-04 13:07:43.000000000 -0700 @@ -1156,6 +1156,8 @@ static void __free_slab(struct kmem_cach NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE, -pages); + __ClearPageSlab(page); + reset_page_mapcount(page); __free_pages(page, s->order); } @@ -1183,8 +1185,6 @@ static void free_slab(struct kmem_cache static void discard_slab(struct kmem_cache *s, struct page *page) { dec_slabs_node(s, page_to_nid(page)); - reset_page_mapcount(page); - __ClearPageSlab(page); free_slab(s, page); }