From: Luiz Capitulino <lcapitulino@redhat.com>
To: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
Andi Kleen <ak@linux.intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH] hugetlb, x86: register 1G page size if we can allocate them runtime
Date: Wed, 4 Feb 2015 12:47:05 -0500 [thread overview]
Message-ID: <20150204124705.21f669bd@redhat.com> (raw)
In-Reply-To: <1423050871-122636-1-git-send-email-kirill.shutemov@linux.intel.com>
On Wed, 4 Feb 2015 13:54:31 +0200
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> wrote:
> After commit 944d9fec8d7a we can allocate 1G pages runtime if CMA is
> enabled.
>
> Let's register 1G pages into hugetlb even if user hasn't requested them
> explicitly at boot time with hugepagesz=1G.
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Cc: Luiz Capitulino <lcapitulino@redhat.com>
> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> Cc: Andi Kleen <ak@linux.intel.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> ---
> arch/x86/mm/hugetlbpage.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
> index 9161f764121e..42982b26e32b 100644
> --- a/arch/x86/mm/hugetlbpage.c
> +++ b/arch/x86/mm/hugetlbpage.c
> @@ -172,4 +172,15 @@ static __init int setup_hugepagesz(char *opt)
> return 1;
> }
> __setup("hugepagesz=", setup_hugepagesz);
> +
> +#ifdef CONFIG_CMA
> +static __init int gigantic_pages_init(void)
> +{
> + /* With CMA we can allocate gigantic pages at runtime */
> + if (cpu_has_gbpages && !size_to_hstate(1UL << PUD_SHIFT))
> + hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT);
> + return 0;
> +}
> +arch_initcall(gigantic_pages_init);
> +#endif
> #endif
Very nice! I was thinking about this for a long time but I don't
think my implementation would be that simple:
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
--
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>
WARNING: multiple messages have this Message-ID (diff)
From: Luiz Capitulino <lcapitulino@redhat.com>
To: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
Andi Kleen <ak@linux.intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH] hugetlb, x86: register 1G page size if we can allocate them runtime
Date: Wed, 4 Feb 2015 12:47:05 -0500 [thread overview]
Message-ID: <20150204124705.21f669bd@redhat.com> (raw)
In-Reply-To: <1423050871-122636-1-git-send-email-kirill.shutemov@linux.intel.com>
On Wed, 4 Feb 2015 13:54:31 +0200
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> wrote:
> After commit 944d9fec8d7a we can allocate 1G pages runtime if CMA is
> enabled.
>
> Let's register 1G pages into hugetlb even if user hasn't requested them
> explicitly at boot time with hugepagesz=1G.
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Cc: Luiz Capitulino <lcapitulino@redhat.com>
> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> Cc: Andi Kleen <ak@linux.intel.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> ---
> arch/x86/mm/hugetlbpage.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
> index 9161f764121e..42982b26e32b 100644
> --- a/arch/x86/mm/hugetlbpage.c
> +++ b/arch/x86/mm/hugetlbpage.c
> @@ -172,4 +172,15 @@ static __init int setup_hugepagesz(char *opt)
> return 1;
> }
> __setup("hugepagesz=", setup_hugepagesz);
> +
> +#ifdef CONFIG_CMA
> +static __init int gigantic_pages_init(void)
> +{
> + /* With CMA we can allocate gigantic pages at runtime */
> + if (cpu_has_gbpages && !size_to_hstate(1UL << PUD_SHIFT))
> + hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT);
> + return 0;
> +}
> +arch_initcall(gigantic_pages_init);
> +#endif
> #endif
Very nice! I was thinking about this for a long time but I don't
think my implementation would be that simple:
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
next prev parent reply other threads:[~2015-02-04 17:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-04 11:54 [PATCH] hugetlb, x86: register 1G page size if we can allocate them runtime Kirill A. Shutemov
2015-02-04 11:54 ` Kirill A. Shutemov
2015-02-04 17:47 ` Luiz Capitulino [this message]
2015-02-04 17:47 ` Luiz Capitulino
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150204124705.21f669bd@redhat.com \
--to=lcapitulino@redhat.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@redhat.com \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.