* HUGETLB pages on multiple nodes
@ 2003-07-14 19:20 Nick Pollitt
2003-07-14 19:40 ` William Lee Irwin III
2003-07-17 15:20 ` Christoph Hellwig
0 siblings, 2 replies; 3+ messages in thread
From: Nick Pollitt @ 2003-07-14 19:20 UTC (permalink / raw)
To: linux-ia64
Seth, It looks like at boot time all the hugepages will get allocated
on the boot node. We'd like to spread the pages across multiple nodes
on NUMA systems. Here's a simple patch to round-robin the pages during
kernel init. Comments?
Nick
=== arch/ia64/mm/hugetlbpage.c 1.2 vs edited ==--- 1.2/arch/ia64/mm/hugetlbpage.c Mon May 19 09:18:44 2003
+++ edited/arch/ia64/mm/hugetlbpage.c Thu Jul 10 11:35:05 2003
@@ -419,7 +419,12 @@
struct page *page;
for (i = 0; i < htlbpage_max; ++i) {
+#ifdef CONFIG_NUMA
+ int node = i % num_memblks;
+ page = alloc_pages_node(node, __GFP_HIGHMEM, HUGETLB_PAGE_ORDER);
+#else
page = alloc_pages(__GFP_HIGHMEM, HUGETLB_PAGE_ORDER);
+#endif /* CONFIG_NUMA */
if (!page)
break;
for (j = 0; j < HPAGE_SIZE/PAGE_SIZE; ++j)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: HUGETLB pages on multiple nodes
2003-07-14 19:20 HUGETLB pages on multiple nodes Nick Pollitt
@ 2003-07-14 19:40 ` William Lee Irwin III
2003-07-17 15:20 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: William Lee Irwin III @ 2003-07-14 19:40 UTC (permalink / raw)
To: linux-ia64
On Mon, Jul 14, 2003 at 12:20:37PM -0700, Nick Pollitt wrote:
> Seth, It looks like at boot time all the hugepages will get allocated
> on the boot node. We'd like to spread the pages across multiple nodes
> on NUMA systems. Here's a simple patch to round-robin the pages during
> kernel init. Comments?
I shipped some stuff for arch/i386/ that does node-local allocations at
runtime, too.
-- wli
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: HUGETLB pages on multiple nodes
2003-07-14 19:20 HUGETLB pages on multiple nodes Nick Pollitt
2003-07-14 19:40 ` William Lee Irwin III
@ 2003-07-17 15:20 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2003-07-17 15:20 UTC (permalink / raw)
To: linux-ia64
On Mon, Jul 14, 2003 at 12:20:37PM -0700, Nick Pollitt wrote:
> +#ifdef CONFIG_NUMA
> + int node = i % num_memblks;
> + page = alloc_pages_node(node, __GFP_HIGHMEM, HUGETLB_PAGE_ORDER);
> +#else
> page = alloc_pages(__GFP_HIGHMEM, HUGETLB_PAGE_ORDER);
> +#endif /* CONFIG_NUMA */
Why the num_memblks? We care for nodes, not memblks, don't we?
Also you can just use alloc_pages_node directly in the non-NUMA code.
See how alloc_pages is implemented in 2.5:
#define alloc_pages(gfp_mask, order) \
alloc_pages_node(numa_node_id(), gfp_mask, order)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-07-17 15:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-14 19:20 HUGETLB pages on multiple nodes Nick Pollitt
2003-07-14 19:40 ` William Lee Irwin III
2003-07-17 15:20 ` Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.