Commit 6ccf80eb15ccaca4d3f1ab5162b9ded5eecd9971

Authored by KOSAKI Motohiro
Committed by Linus Torvalds
1 parent 1f0b8b9554

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -1222,10 +1222,10 @@
1222 1222 }
1223 1223 spin_lock_irqsave(&zone->lock, flags);
1224 1224 page = __rmqueue(zone, order, migratetype);
1225   - __mod_zone_page_state(zone, NR_FREE_PAGES, -(1 << order));
1226 1225 spin_unlock(&zone->lock);
1227 1226 if (!page)
1228 1227 goto failed;
  1228 + __mod_zone_page_state(zone, NR_FREE_PAGES, -(1 << order));
1229 1229 }
1230 1230  
1231 1231 __count_zone_vm_events(PGALLOC, zone, 1 << order);