diff options
author | Paul Jackson <pj@sgi.com> | 2006-03-22 03:09:10 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-22 10:54:06 -0500 |
commit | fdb7cc59084ba7eef935e4e40aaaf538ee34c625 (patch) | |
tree | d31bd847f2d9ea3f5b2a632c718b53797172af88 | |
parent | 9b65ef59d42a56fa1358958ede77aaa5bac385a8 (diff) |
[PATCH] mm: hugetlb alloc_fresh_huge_page bogus node loop fix
Fix bogus node loop in hugetlb.c alloc_fresh_huge_page(), which was
assuming that nodes are numbered contiguously from 0 to num_online_nodes().
Once the hotplug folks get this far, that will be false.
Signed-off-by: Paul Jackson <pj@sgi.com>
Acked-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | mm/hugetlb.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 06699d871a8e..ebad6bbb3501 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -105,7 +105,9 @@ static int alloc_fresh_huge_page(void) | |||
105 | struct page *page; | 105 | struct page *page; |
106 | page = alloc_pages_node(nid, GFP_HIGHUSER|__GFP_COMP|__GFP_NOWARN, | 106 | page = alloc_pages_node(nid, GFP_HIGHUSER|__GFP_COMP|__GFP_NOWARN, |
107 | HUGETLB_PAGE_ORDER); | 107 | HUGETLB_PAGE_ORDER); |
108 | nid = (nid + 1) % num_online_nodes(); | 108 | nid = next_node(nid, node_online_map); |
109 | if (nid == MAX_NUMNODES) | ||
110 | nid = first_node(node_online_map); | ||
109 | if (page) { | 111 | if (page) { |
110 | page[1].lru.next = (void *)free_huge_page; /* dtor */ | 112 | page[1].lru.next = (void *)free_huge_page; /* dtor */ |
111 | spin_lock(&hugetlb_lock); | 113 | spin_lock(&hugetlb_lock); |