aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2005-11-17 15:35:02 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-17 15:43:01 -0500
commit6b1de9161e973bac8c4675db608fe4f38d2689bd (patch)
tree3ab6aaad7d22dcb7a00a339b8b49c2f5b2ecc12d /mm/page_alloc.c
parentbb833986674ce1fc1b237b3d81459511ad2df393 (diff)
[PATCH] VM: fix zone list restart in page allocatate
We must reassign z before looping through the zones kicking kswapd, since it will be NULL if we hit an OOM condition and jump back to the beginning again. 'z' is initially assigned before the restart: label. So move the restart label up a little. Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 104e69ca55e0..bd4de592dc23 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -845,21 +845,22 @@ __alloc_pages(gfp_t gfp_mask, unsigned int order,
845 845
846 might_sleep_if(wait); 846 might_sleep_if(wait);
847 847
848restart:
848 z = zonelist->zones; /* the list of zones suitable for gfp_mask */ 849 z = zonelist->zones; /* the list of zones suitable for gfp_mask */
849 850
850 if (unlikely(*z == NULL)) { 851 if (unlikely(*z == NULL)) {
851 /* Should this ever happen?? */ 852 /* Should this ever happen?? */
852 return NULL; 853 return NULL;
853 } 854 }
854restart: 855
855 page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, order, 856 page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, order,
856 zonelist, ALLOC_CPUSET); 857 zonelist, ALLOC_CPUSET);
857 if (page) 858 if (page)
858 goto got_pg; 859 goto got_pg;
859 860
860 do 861 do {
861 wakeup_kswapd(*z, order); 862 wakeup_kswapd(*z, order);
862 while (*(++z)); 863 } while (*(++z));
863 864
864 /* 865 /*
865 * OK, we're below the kswapd watermark and have kicked background 866 * OK, we're below the kswapd watermark and have kicked background