[PATCH] mm: hugetlb alloc_fresh_huge_page bogus node loop fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Paul Jackson <[email protected]>

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 <[email protected]>

---

 mm/hugetlb.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

--- 2.6.16-rc6-mm2.orig/mm/hugetlb.c	2006-03-18 17:29:46.645251774 -0800
+++ 2.6.16-rc6-mm2/mm/hugetlb.c	2006-03-18 21:43:05.101700297 -0800
@@ -105,7 +105,9 @@ static int alloc_fresh_huge_page(void)
 	struct page *page;
 	page = alloc_pages_node(nid, GFP_HIGHUSER|__GFP_COMP|__GFP_NOWARN,
 					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) {
 		page[1].lru.next = (void *)free_huge_page;	/* dtor */
 		spin_lock(&hugetlb_lock);

-- 
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <[email protected]> 1.650.933.1373
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux