Commit 6b1de916 authored by Jens Axboe's avatar Jens Axboe Committed by Linus Torvalds

[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: default avatarJens Axboe <axboe@suse.de>
parent bb833986
...@@ -845,21 +845,22 @@ __alloc_pages(gfp_t gfp_mask, unsigned int order, ...@@ -845,21 +845,22 @@ __alloc_pages(gfp_t gfp_mask, unsigned int order,
might_sleep_if(wait); might_sleep_if(wait);
restart:
z = zonelist->zones; /* the list of zones suitable for gfp_mask */ z = zonelist->zones; /* the list of zones suitable for gfp_mask */
if (unlikely(*z == NULL)) { if (unlikely(*z == NULL)) {
/* Should this ever happen?? */ /* Should this ever happen?? */
return NULL; return NULL;
} }
restart:
page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, order, page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, order,
zonelist, ALLOC_CPUSET); zonelist, ALLOC_CPUSET);
if (page) if (page)
goto got_pg; goto got_pg;
do do {
wakeup_kswapd(*z, order); wakeup_kswapd(*z, order);
while (*(++z)); } while (*(++z));
/* /*
* OK, we're below the kswapd watermark and have kicked background * OK, we're below the kswapd watermark and have kicked background
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment