* [PATCH] hugetlb: restore interleaving of bootmem huge pages
@ 2009-07-16 14:31 Lee Schermerhorn
2009-07-16 14:51 ` Mel Gorman
2009-07-16 17:31 ` Andy Whitcroft
0 siblings, 2 replies; 4+ messages in thread
From: Lee Schermerhorn @ 2009-07-16 14:31 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-mm, Mel Gorman, Nishanth Aravamudan, David Rientjes,
Adam Litke, Andy Whitcroft, Eric Whitney, linux-numa
PATCH restore interleaving of bootmem huge pages
Against: 2.6.31-rc1-mmotm-090625-1549
atop the "hugetlb-balance-freeing-of-huge-pages-across-node" series
I noticed that alloc_bootmem_huge_page() will only advance to the
next node on failure to allocate a huge page, potentially filling
nodes with huge-pages. I asked about this on linux-mm and linux-numa,
cc'ing the usual huge page suspects.
Mel Gorman responded:
I strongly suspect that the same node being used until allocation
failure instead of round-robin is an oversight and not deliberate
at all. It appears to be a side-effect of a fix made way back in
commit 63b4613c3f0d4b724ba259dc6c201bb68b884e1a ["hugetlb: fix
hugepage allocation with memoryless nodes"]. Prior to that patch
it looked like allocations would always round-robin even when
allocation was successful.
This patch--factored out of my "hugetlb mempolicy" series--moves the
advance of the hstate next node from which to allocate up before the
test for success of the attempted allocation.
Note that alloc_bootmem_huge_page() is only used for order > MAX_ORDER
huge pages.
I'll post a separate patch for mainline/stable, as the above mentioned
"balance freeing" series renamed the next node to alloc function.
Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
mm/hugetlb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-2.6.31-rc1-mmotm-090625-1549/mm/hugetlb.c
===================================================================
--- linux-2.6.31-rc1-mmotm-090625-1549.orig/mm/hugetlb.c 2009-07-13 09:05:22.000000000 -0400
+++ linux-2.6.31-rc1-mmotm-090625-1549/mm/hugetlb.c 2009-07-13 09:06:22.000000000 -0400
@@ -1030,6 +1030,7 @@ int __weak alloc_bootmem_huge_page(struc
NODE_DATA(h->next_nid_to_alloc),
huge_page_size(h), huge_page_size(h), 0);
+ hstate_next_node_to_alloc(h);
if (addr) {
/*
* Use the beginning of the huge page to store the
@@ -1039,7 +1040,6 @@ int __weak alloc_bootmem_huge_page(struc
m = addr;
goto found;
}
- hstate_next_node_to_alloc(h);
nr_nodes--;
}
return 0;
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hugetlb: restore interleaving of bootmem huge pages
2009-07-16 14:31 [PATCH] hugetlb: restore interleaving of bootmem huge pages Lee Schermerhorn
@ 2009-07-16 14:51 ` Mel Gorman
2009-07-16 17:31 ` Andy Whitcroft
1 sibling, 0 replies; 4+ messages in thread
From: Mel Gorman @ 2009-07-16 14:51 UTC (permalink / raw)
To: Lee Schermerhorn
Cc: Andrew Morton, linux-mm, Nishanth Aravamudan, David Rientjes,
Adam Litke, Andy Whitcroft, Eric Whitney, linux-numa
On Thu, Jul 16, 2009 at 10:31:02AM -0400, Lee Schermerhorn wrote:
> PATCH restore interleaving of bootmem huge pages
>
> Against: 2.6.31-rc1-mmotm-090625-1549
> atop the "hugetlb-balance-freeing-of-huge-pages-across-node" series
>
> I noticed that alloc_bootmem_huge_page() will only advance to the
> next node on failure to allocate a huge page, potentially filling
> nodes with huge-pages. I asked about this on linux-mm and linux-numa,
> cc'ing the usual huge page suspects.
>
> Mel Gorman responded:
>
> I strongly suspect that the same node being used until allocation
> failure instead of round-robin is an oversight and not deliberate
> at all. It appears to be a side-effect of a fix made way back in
> commit 63b4613c3f0d4b724ba259dc6c201bb68b884e1a ["hugetlb: fix
> hugepage allocation with memoryless nodes"]. Prior to that patch
> it looked like allocations would always round-robin even when
> allocation was successful.
>
> This patch--factored out of my "hugetlb mempolicy" series--moves the
> advance of the hstate next node from which to allocate up before the
> test for success of the attempted allocation.
>
> Note that alloc_bootmem_huge_page() is only used for order > MAX_ORDER
> huge pages.
>
> I'll post a separate patch for mainline/stable, as the above mentioned
> "balance freeing" series renamed the next node to alloc function.
>
> Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Reviewed-by: Mel Gorman <mel@csn.ul.ie>
>
> mm/hugetlb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: linux-2.6.31-rc1-mmotm-090625-1549/mm/hugetlb.c
> ===================================================================
> --- linux-2.6.31-rc1-mmotm-090625-1549.orig/mm/hugetlb.c 2009-07-13 09:05:22.000000000 -0400
> +++ linux-2.6.31-rc1-mmotm-090625-1549/mm/hugetlb.c 2009-07-13 09:06:22.000000000 -0400
> @@ -1030,6 +1030,7 @@ int __weak alloc_bootmem_huge_page(struc
> NODE_DATA(h->next_nid_to_alloc),
> huge_page_size(h), huge_page_size(h), 0);
>
> + hstate_next_node_to_alloc(h);
> if (addr) {
> /*
> * Use the beginning of the huge page to store the
> @@ -1039,7 +1040,6 @@ int __weak alloc_bootmem_huge_page(struc
> m = addr;
> goto found;
> }
> - hstate_next_node_to_alloc(h);
> nr_nodes--;
> }
> return 0;
>
>
--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hugetlb: restore interleaving of bootmem huge pages
2009-07-16 14:31 [PATCH] hugetlb: restore interleaving of bootmem huge pages Lee Schermerhorn
2009-07-16 14:51 ` Mel Gorman
@ 2009-07-16 17:31 ` Andy Whitcroft
2009-07-16 18:17 ` Andi Kleen
1 sibling, 1 reply; 4+ messages in thread
From: Andy Whitcroft @ 2009-07-16 17:31 UTC (permalink / raw)
To: Lee Schermerhorn
Cc: Andrew Morton, linux-mm, Mel Gorman, Nishanth Aravamudan,
David Rientjes, Adam Litke, Eric Whitney, linux-numa
On Thu, Jul 16, 2009 at 10:31:02AM -0400, Lee Schermerhorn wrote:
> PATCH restore interleaving of bootmem huge pages
>
> Against: 2.6.31-rc1-mmotm-090625-1549
> atop the "hugetlb-balance-freeing-of-huge-pages-across-node" series
>
> I noticed that alloc_bootmem_huge_page() will only advance to the
> next node on failure to allocate a huge page, potentially filling
> nodes with huge-pages. I asked about this on linux-mm and linux-numa,
> cc'ing the usual huge page suspects.
>
> Mel Gorman responded:
>
> I strongly suspect that the same node being used until allocation
> failure instead of round-robin is an oversight and not deliberate
> at all. It appears to be a side-effect of a fix made way back in
> commit 63b4613c3f0d4b724ba259dc6c201bb68b884e1a ["hugetlb: fix
> hugepage allocation with memoryless nodes"]. Prior to that patch
> it looked like allocations would always round-robin even when
> allocation was successful.
>
> This patch--factored out of my "hugetlb mempolicy" series--moves the
> advance of the hstate next node from which to allocate up before the
> test for success of the attempted allocation.
>
> Note that alloc_bootmem_huge_page() is only used for order > MAX_ORDER
> huge pages.
>
> I'll post a separate patch for mainline/stable, as the above mentioned
> "balance freeing" series renamed the next node to alloc function.
>
> Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
It looks like this behaviour was in the original implementation to my eye.
It does indeed seem to prefer taking all it can from one node before moving
on to the next. Your change seems reasonable to my eye though it may be
worth asking Andi if it was intended. The intent of this change seems
to bring the behaviour into line with that of alloc_fresh_huge_page()
used for orders less than MAX_ORDER.
Reviewed-by: Andy Whitcroft <apw@canonical.com>
-apw
>
> mm/hugetlb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: linux-2.6.31-rc1-mmotm-090625-1549/mm/hugetlb.c
> ===================================================================
> --- linux-2.6.31-rc1-mmotm-090625-1549.orig/mm/hugetlb.c 2009-07-13 09:05:22.000000000 -0400
> +++ linux-2.6.31-rc1-mmotm-090625-1549/mm/hugetlb.c 2009-07-13 09:06:22.000000000 -0400
> @@ -1030,6 +1030,7 @@ int __weak alloc_bootmem_huge_page(struc
> NODE_DATA(h->next_nid_to_alloc),
> huge_page_size(h), huge_page_size(h), 0);
>
> + hstate_next_node_to_alloc(h);
> if (addr) {
> /*
> * Use the beginning of the huge page to store the
> @@ -1039,7 +1040,6 @@ int __weak alloc_bootmem_huge_page(struc
> m = addr;
> goto found;
> }
> - hstate_next_node_to_alloc(h);
> nr_nodes--;
> }
> return 0;
>
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hugetlb: restore interleaving of bootmem huge pages
2009-07-16 17:31 ` Andy Whitcroft
@ 2009-07-16 18:17 ` Andi Kleen
0 siblings, 0 replies; 4+ messages in thread
From: Andi Kleen @ 2009-07-16 18:17 UTC (permalink / raw)
To: Andy Whitcroft
Cc: Lee Schermerhorn, Andrew Morton, linux-mm, Mel Gorman,
Nishanth Aravamudan, David Rientjes, Adam Litke, Eric Whitney,
linux-numa
> It looks like this behaviour was in the original implementation to my eye.
> It does indeed seem to prefer taking all it can from one node before moving
> on to the next. Your change seems reasonable to my eye though it may be
> worth asking Andi if it was intended. The intent of this change seems
> to bring the behaviour into line with that of alloc_fresh_huge_page()
> used for orders less than MAX_ORDER.
I don't remember intending it this way. The intention was always
standard round robin one by one. If it didn't do that it wasn't extended.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-07-16 18:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-16 14:31 [PATCH] hugetlb: restore interleaving of bootmem huge pages Lee Schermerhorn
2009-07-16 14:51 ` Mel Gorman
2009-07-16 17:31 ` Andy Whitcroft
2009-07-16 18:17 ` Andi Kleen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).