Huge pages: Use for_each_node instead of coding a loop over all nodes There is one remaining case of a loop coded over all nodes. The use of for_each_node will make the loop look like other loops over nodes. We will also only inspect nodes that are online which may increase performance. Signed-off-by: Christoph Lameter Index: linux-2.6.20-rc6-mm3/mm/hugetlb.c =================================================================== --- linux-2.6.20-rc6-mm3.orig/mm/hugetlb.c 2007-01-31 10:52:10.000000000 -0800 +++ linux-2.6.20-rc6-mm3/mm/hugetlb.c 2007-01-31 10:52:32.000000000 -0800 @@ -191,11 +191,11 @@ static void update_and_free_page(struct #ifdef CONFIG_HIGHMEM static void try_to_free_low(unsigned long count) { - int i; + int node; - for (i = 0; i < MAX_NUMNODES; ++i) { + for_each_node(node) { struct page *page, *next; - list_for_each_entry_safe(page, next, &hugepage_freelists[i], lru) { + list_for_each_entry_safe(page, next, &hugepage_freelists[node], lru) { if (PageHighMem(page)) continue; list_del(&page->lru);