diff options
author | Jens Axboe <axboe@suse.de> | 2005-11-17 21:35:02 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-17 12:43:01 -0800 |
commit | 6b1de9161e973bac8c4675db608fe4f38d2689bd (patch) | |
tree | 3ab6aaad7d22dcb7a00a339b8b49c2f5b2ecc12d /mm | |
parent | bb833986674ce1fc1b237b3d81459511ad2df393 (diff) | |
download | linux-3.10-6b1de9161e973bac8c4675db608fe4f38d2689bd.tar.gz linux-3.10-6b1de9161e973bac8c4675db608fe4f38d2689bd.tar.bz2 linux-3.10-6b1de9161e973bac8c4675db608fe4f38d2689bd.zip |
[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')
-rw-r--r-- | mm/page_alloc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 104e69ca55e..bd4de592dc2 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -845,21 +845,22 @@ __alloc_pages(gfp_t gfp_mask, unsigned int order, might_sleep_if(wait); +restart: z = zonelist->zones; /* the list of zones suitable for gfp_mask */ if (unlikely(*z == NULL)) { /* Should this ever happen?? */ return NULL; } -restart: + page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, order, zonelist, ALLOC_CPUSET); if (page) goto got_pg; - do + do { wakeup_kswapd(*z, order); - while (*(++z)); + } while (*(++z)); /* * OK, we're below the kswapd watermark and have kicked background |