Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fdb7cc59 authored by Paul Jackson's avatar Paul Jackson Committed by Linus Torvalds
Browse files

[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: default avatarPaul Jackson <pj@sgi.com>
Acked-by: default avatarChristoph Lameter <clameter@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9b65ef59
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -105,7 +105,9 @@ static int alloc_fresh_huge_page(void)
	struct page *page;
	struct page *page;
	page = alloc_pages_node(nid, GFP_HIGHUSER|__GFP_COMP|__GFP_NOWARN,
	page = alloc_pages_node(nid, GFP_HIGHUSER|__GFP_COMP|__GFP_NOWARN,
					HUGETLB_PAGE_ORDER);
					HUGETLB_PAGE_ORDER);
	nid = (nid + 1) % num_online_nodes();
	nid = next_node(nid, node_online_map);
	if (nid == MAX_NUMNODES)
		nid = first_node(node_online_map);
	if (page) {
	if (page) {
		page[1].lru.next = (void *)free_huge_page;	/* dtor */
		page[1].lru.next = (void *)free_huge_page;	/* dtor */
		spin_lock(&hugetlb_lock);
		spin_lock(&hugetlb_lock);