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) ...@@ -805,13 +805,13 @@ static inline void *kmem_getpages(kmem_cache_t *cachep, unsigned long flags)
void *addr; void *addr;
flags |= cachep->gfpflags; 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); addr = (void*)__get_free_pages(flags, cachep->gfporder);
if (addr) { if (addr) {
int i = (1 << cachep->gfporder); int i = (1 << cachep->gfporder);
struct page *page = virt_to_page(addr); struct page *page = virt_to_page(addr);
if (cachep->flags & SLAB_RECLAIM_ACCOUNT)
atomic_add(i, &slab_reclaim_pages);
while (i--) { while (i--) {
SetPageSlab(page); SetPageSlab(page);
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