diff options
-rw-r--r-- | mm/hugetlb.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index da8a211414c9..e93bd63462f0 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -40,14 +40,16 @@ static struct page *dequeue_huge_page(void) | |||
40 | { | 40 | { |
41 | int nid = numa_node_id(); | 41 | int nid = numa_node_id(); |
42 | struct page *page = NULL; | 42 | struct page *page = NULL; |
43 | struct zonelist *zonelist = NODE_DATA(nid)->node_zonelists; | ||
44 | struct zone **z; | ||
43 | 45 | ||
44 | if (list_empty(&hugepage_freelists[nid])) { | 46 | for (z = zonelist->zones; *z; z++) { |
45 | for (nid = 0; nid < MAX_NUMNODES; ++nid) | 47 | nid = (*z)->zone_pgdat->node_id; |
46 | if (!list_empty(&hugepage_freelists[nid])) | 48 | if (!list_empty(&hugepage_freelists[nid])) |
47 | break; | 49 | break; |
48 | } | 50 | } |
49 | if (nid >= 0 && nid < MAX_NUMNODES && | 51 | |
50 | !list_empty(&hugepage_freelists[nid])) { | 52 | if (*z) { |
51 | page = list_entry(hugepage_freelists[nid].next, | 53 | page = list_entry(hugepage_freelists[nid].next, |
52 | struct page, lru); | 54 | struct page, lru); |
53 | list_del(&page->lru); | 55 | list_del(&page->lru); |