]> Git Repo - linux.git/commitdiff
page allocator: update NR_FREE_PAGES only when necessary
authorKOSAKI Motohiro <[email protected]>
Sat, 16 Jan 2010 01:01:18 +0000 (17:01 -0800)
committerLinus Torvalds <[email protected]>
Sun, 17 Jan 2010 00:53:55 +0000 (16:53 -0800)
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 <[email protected]>
Cc: Mel Gorman <[email protected]>
Reviewed-by: Minchan Kim <[email protected]>
Reported-by: Huang Shijie <[email protected]>
Reviewed-by: Christoph Lameter <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/page_alloc.c

index 6ea4966a6334cf49548a3eda420faf61d7607728..d2a8889b4c5896b2fd9a6c330f3963893fb317f9 100644 (file)
@@ -1222,10 +1222,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);
This page took 0.064641 seconds and 4 git commands to generate.