aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>2010-01-15 20:01:18 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-01-16 19:53:55 -0500
commit6ccf80eb15ccaca4d3f1ab5162b9ded5eecd9971 (patch)
tree23dad05636e88a743755bfd3e7a5dad4ef5e49e0
parent1f0b8b95543118f97197a978560438c1ce88cd00 (diff)
page allocator: update NR_FREE_PAGES only when necessary
commit f2260e6b (page allocator: update NR_FREE_PAGES only as necessary) made one minor regression. if __rmqueue() was failed, NR_FREE_PAGES stat go wrong. this patch fixes it. Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Mel Gorman <mel@csn.ul.ie> Reviewed-by: Minchan Kim <minchan.kim@gmail.com> Reported-by: Huang Shijie <shijie8@gmail.com> Reviewed-by: Christoph Lameter <cl@linux-foundation.org> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/page_alloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 6ea4966a6334..d2a8889b4c58 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1222,10 +1222,10 @@ again:
1222 } 1222 }
1223 spin_lock_irqsave(&zone->lock, flags); 1223 spin_lock_irqsave(&zone->lock, flags);
1224 page = __rmqueue(zone, order, migratetype); 1224 page = __rmqueue(zone, order, migratetype);
1225 __mod_zone_page_state(zone, NR_FREE_PAGES, -(1 << order));
1226 spin_unlock(&zone->lock); 1225 spin_unlock(&zone->lock);
1227 if (!page) 1226 if (!page)
1228 goto failed; 1227 goto failed;
1228 __mod_zone_page_state(zone, NR_FREE_PAGES, -(1 << order));
1229 } 1229 }
1230 1230
1231 __count_zone_vm_events(PGALLOC, zone, 1 << order); 1231 __count_zone_vm_events(PGALLOC, zone, 1 << order);