mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
page allocator: update NR_FREE_PAGES only when necessary
commit6ccf80eb15upstream. commitf2260e6b(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> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d4c893f207
commit
c91ab0438c
@@ -1225,10 +1225,10 @@ again:
|
||||
}
|
||||
spin_lock_irqsave(&zone->lock, flags);
|
||||
page = __rmqueue(zone, order, migratetype);
|
||||
__mod_zone_page_state(zone, NR_FREE_PAGES, -(1 << order));
|
||||
spin_unlock(&zone->lock);
|
||||
if (!page)
|
||||
goto failed;
|
||||
__mod_zone_page_state(zone, NR_FREE_PAGES, -(1 << order));
|
||||
}
|
||||
|
||||
__count_zone_vm_events(PGALLOC, zone, 1 << order);
|
||||
|
||||
Reference in New Issue
Block a user