* [patch] hugetlb: override default huge page size non-const fix
@ 2008-07-23 4:06 Nick Piggin
2008-07-24 7:29 ` Jon Tollefson
0 siblings, 1 reply; 2+ messages in thread
From: Nick Piggin @ 2008-07-23 4:06 UTC (permalink / raw)
To: Andrew Morton
Cc: Jon Tollefson, Adam Litke, Nishanth Aravamudan,
Linux Memory Management List
Hi,
I revisited the multi-size hugetlb patches, and realised I forgot one small
outstanding issue. Your
hugetlb-override-default-huge-page-size-ia64-build.patch
fix basically disallows overriding of the default hugetlb size, because we
always set the default back to HPAGE_SIZE.
A better fix I think is just to initialize the default_hstate_size to an
invalid value, which the init code checks for and reverts to HPAGE_SIZE
anyway. So please replace that patch with this one.
Overriding of the default hugepage size is not of major importance, but it
can allow legacy code (providing it is well written), including the hugetlb
regression suite to be run with different hugepage sizes (so actually it is
quite important for developers at least).
I don't have access to such a machine, but I hope (with this patch), the
powerpc developers can run the libhugetlb regression suite one last time
against a range of page sizes and ensure the results look reasonable.
Thanks,
Nick
--
If HPAGE_SIZE is not constant (eg. on ia64), then the initialiser does not
work. Fix this by making default_hstate_size == 0, then if it isn't set
from the cmdline, hugetlb_init will still do the right thing and set up the
default hstate as (the now initialized) HPAGE_SIZE.
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/mm/hugetlb.c
===================================================================
--- linux-2.6.orig/mm/hugetlb.c
+++ linux-2.6/mm/hugetlb.c
@@ -34,7 +34,7 @@ struct hstate hstates[HUGE_MAX_HSTATE];
/* for command line parsing */
static struct hstate * __initdata parsed_hstate;
static unsigned long __initdata default_hstate_max_huge_pages;
-static unsigned long __initdata default_hstate_size = HPAGE_SIZE;
+static unsigned long __initdata default_hstate_size = 0;
#define for_each_hstate(h) \
for ((h) = hstates; (h) < &hstates[max_hstate]; (h)++)
--
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] 2+ messages in thread
* Re: [patch] hugetlb: override default huge page size non-const fix
2008-07-23 4:06 [patch] hugetlb: override default huge page size non-const fix Nick Piggin
@ 2008-07-24 7:29 ` Jon Tollefson
0 siblings, 0 replies; 2+ messages in thread
From: Jon Tollefson @ 2008-07-24 7:29 UTC (permalink / raw)
To: Nick Piggin
Cc: Andrew Morton, Adam Litke, Nishanth Aravamudan,
Linux Memory Management List
Nick Piggin wrote:
> Hi,
>
> I revisited the multi-size hugetlb patches, and realised I forgot one small
> outstanding issue. Your
> hugetlb-override-default-huge-page-size-ia64-build.patch
> fix basically disallows overriding of the default hugetlb size, because we
> always set the default back to HPAGE_SIZE.
>
> A better fix I think is just to initialize the default_hstate_size to an
> invalid value, which the init code checks for and reverts to HPAGE_SIZE
> anyway. So please replace that patch with this one.
>
> Overriding of the default hugepage size is not of major importance, but it
> can allow legacy code (providing it is well written), including the hugetlb
> regression suite to be run with different hugepage sizes (so actually it is
> quite important for developers at least).
>
> I don't have access to such a machine, but I hope (with this patch), the
> powerpc developers can run the libhugetlb regression suite one last time
> against a range of page sizes and ensure the results look reasonable.
>
I am a little slow here, but I was able to boot with
default_hugepagesz=64K and 16G on Power and it set the default huge page
size to the given size.
Jon
> Thanks,
> Nick
>
> --
>
> If HPAGE_SIZE is not constant (eg. on ia64), then the initialiser does not
> work. Fix this by making default_hstate_size == 0, then if it isn't set
> from the cmdline, hugetlb_init will still do the right thing and set up the
> default hstate as (the now initialized) HPAGE_SIZE.
>
> Signed-off-by: Nick Piggin <npiggin@suse.de>
> ---
> Index: linux-2.6/mm/hugetlb.c
> ===================================================================
> --- linux-2.6.orig/mm/hugetlb.c
> +++ linux-2.6/mm/hugetlb.c
> @@ -34,7 +34,7 @@ struct hstate hstates[HUGE_MAX_HSTATE];
> /* for command line parsing */
> static struct hstate * __initdata parsed_hstate;
> static unsigned long __initdata default_hstate_max_huge_pages;
> -static unsigned long __initdata default_hstate_size = HPAGE_SIZE;
> +static unsigned long __initdata default_hstate_size = 0;
>
> #define for_each_hstate(h) \
> for ((h) = hstates; (h) < &hstates[max_hstate]; (h)++)
>
--
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] 2+ messages in thread
end of thread, other threads:[~2008-07-24 7:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-23 4:06 [patch] hugetlb: override default huge page size non-const fix Nick Piggin
2008-07-24 7:29 ` Jon Tollefson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox