linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Victor Aoqui <victora@br.ibm.com>,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	mpe@ellerman.id.au
Cc: victora@linux.vnet.ibm.com
Subject: Re: [PATCH] powerpc/mm: Implemented default_hugepagesz verification for powerpc
Date: Wed, 5 Jul 2017 09:56:30 +0530	[thread overview]
Message-ID: <1f549637-773a-868c-effd-5614e85aa892@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170703200559.3743-1-victora@br.ibm.com>



On Tuesday 04 July 2017 01:35 AM, Victor Aoqui wrote:
> Implemented default hugepage size verification (default_hugepagesz=)
> in order to allow allocation of defined number of pages (hugepages=)
> only for supported hugepage sizes.
> 
> Signed-off-by: Victor Aoqui <victora@br.ibm.com>
> ---
>   arch/powerpc/mm/hugetlbpage.c | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
> 
> diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
> index a4f33de..464e72e 100644
> --- a/arch/powerpc/mm/hugetlbpage.c
> +++ b/arch/powerpc/mm/hugetlbpage.c
> @@ -797,6 +797,21 @@ static int __init hugepage_setup_sz(char *str)
>   }
>   __setup("hugepagesz=", hugepage_setup_sz);
> 
> +static int __init default_hugepage_setup_sz(char *str)
> +{
> +        unsigned long long size;
> +
> +        size = memparse(str, &str);
> +
> +        if (add_huge_page_size(size) != 0) {
> +                hugetlb_bad_size();
> +                pr_err("Invalid default huge page size specified(%llu)\n", size);
> +        }
> +
> +        return 1;
> +}
> +__setup("default_hugepagesz=", default_hugepage_setup_sz);

isn't that a behavior change in what we have now ? . Right now if size 
specified is not supported, we fallback to HPAGE_SIZE.

mm/hugetlb.c

	if (!size_to_hstate(default_hstate_size)) {
		default_hstate_size = HPAGE_SIZE;
		if (!size_to_hstate(default_hstate_size))
			hugetlb_add_hstate(HUGETLB_PAGE_ORDER);
	}


> +
>   struct kmem_cache *hugepte_cache;
>   static int __init hugetlbpage_init(void)
>   {
> 

Even if we want to do this, this should be done in generic code and 
should not be powerpc specific

-aneesh

  reply	other threads:[~2017-07-05  4:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-03 20:05 [PATCH] powerpc/mm: Implemented default_hugepagesz verification for powerpc Victor Aoqui
2017-07-05  4:26 ` Aneesh Kumar K.V [this message]
2017-07-05 16:03   ` victora
2017-07-12 15:15     ` victora
2017-07-05  4:31 ` Anshuman Khandual
2017-07-05 16:09   ` victora

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=1f549637-773a-868c-effd-5614e85aa892@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=victora@br.ibm.com \
    --cc=victora@linux.vnet.ibm.com \
    /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 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).