From: Manfred Spraul slab_reclaim_pages is increased even if get_free_pages fails. The attached patch moves the update to the correct position. mm/slab.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -puN mm/slab.c~slab-reclaim-accounting-fix mm/slab.c --- 25/mm/slab.c~slab-reclaim-accounting-fix 2003-12-14 21:28:31.000000000 -0800 +++ 25-akpm/mm/slab.c 2003-12-14 21:28:31.000000000 -0800 @@ -805,13 +805,13 @@ static inline void *kmem_getpages(kmem_c void *addr; flags |= cachep->gfpflags; - if (cachep->flags & SLAB_RECLAIM_ACCOUNT) - atomic_add(1<gfporder, &slab_reclaim_pages); addr = (void*)__get_free_pages(flags, cachep->gfporder); if (addr) { int i = (1 << cachep->gfporder); struct page *page = virt_to_page(addr); + if (cachep->flags & SLAB_RECLAIM_ACCOUNT) + atomic_add(i, &slab_reclaim_pages); while (i--) { SetPageSlab(page); page++; _