Commit 1cdf0eef authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] slab reclaim accounting fix

From: Manfred Spraul <manfred@colorfullife.com>

slab_reclaim_pages is increased even if get_free_pages fails.  The attached
patch moves the update to the correct position.
parent 162bc7d1
......@@ -805,13 +805,13 @@ static inline void *kmem_getpages(kmem_cache_t *cachep, unsigned long flags)
void *addr;
flags |= cachep->gfpflags;
if (cachep->flags & SLAB_RECLAIM_ACCOUNT)
atomic_add(1<<cachep->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++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment