From: Christoph Lameter Date: Mon, 14 Apr 2008 15:52:18 +0000 (+0300) Subject: slub: Move map/flag clearing to __free_slab X-Git-Tag: v2.6.26-rc1~1159^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49bd5221ce8fb55d12c04a3ffd375201c5bbfb7a;p=linux-2.6 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 Signed-off-by: Pekka Enberg --- diff --git a/mm/slub.c b/mm/slub.c index 23e5ee7b14..f924cffb29 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1125,6 +1125,8 @@ static void __free_slab(struct kmem_cache *s, struct page *page) NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE, -pages); + __ClearPageSlab(page); + reset_page_mapcount(page); __free_pages(page, s->order); } @@ -1154,8 +1156,6 @@ static void discard_slab(struct kmem_cache *s, struct page *page) struct kmem_cache_node *n = get_node(s, page_to_nid(page)); atomic_long_dec(&n->nr_slabs); - reset_page_mapcount(page); - __ClearPageSlab(page); free_slab(s, page); }