From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Anshuman Khandual <khandual@linux.vnet.ibm.com>,
benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/mm/hugetlb: Add support for reserving gigantic huge pages via kernel command line
Date: Wed, 17 May 2017 12:29:01 +0530 [thread overview]
Message-ID: <ae83b995-5f14-2c1d-3815-0816f0dc8f02@linux.vnet.ibm.com> (raw)
In-Reply-To: <768f38fe-d2ad-df4a-19e3-910b4a584614@linux.vnet.ibm.com>
On Wednesday 17 May 2017 10:31 AM, Anshuman Khandual wrote:
> On 05/16/2017 02:54 PM, Aneesh Kumar K.V wrote:
>> +void __init reserve_hugetlb_gpages(void)
>> +{
>> + char buf[10];
>> + phys_addr_t base;
>> + unsigned long gpage_size = 1UL << 34;
>> + static __initdata char cmdline[COMMAND_LINE_SIZE];
>> +
>> + if (radix_enabled())
>> + gpage_size = 1UL << 30;
>> +
>> + strlcpy(cmdline, boot_command_line, COMMAND_LINE_SIZE);
>> + parse_args("hugetlb gpages", cmdline, NULL, 0, 0, 0,
>> + NULL, &do_gpage_early_setup);
>> +
>> + if (!gpage_npages)
>> + return;
>> +
>> + string_get_size(gpage_size, 1, STRING_UNITS_2, buf, sizeof(buf));
>> + pr_info("Trying to reserve %ld %s pages\n", gpage_npages, buf);
>> +
>> + /* Allocate one page at a time */
>> + while(gpage_npages) {
>> + base = memblock_alloc_base(gpage_size, gpage_size,
>> + MEMBLOCK_ALLOC_ANYWHERE);
>> + add_gpage(base, gpage_size, 1);
>
> For 16GB pages (1UL << 34) on POWER8, we already do these functions
> inside htab_dt_scan_hugepage_blocks(). IIUC this happens just by
> scanning DT without even specifying any gpages in kernel command
> line.
>
> memblock_reserve()
> add_gpage()
>
> Then attempting to allocate from memblock and adding it again into
> gigantic pages list wont collide ?
That is for pseries.ie, pSeries will get the hugpages reserved by phyp
and the details of those pages are passed via device tree. Not sure what
is the conflict here. If we use the above kernel parameter, we will try
to allocate another 'x' number of hugepages.
> More over its trying to allocate
> across the RAM not specifically on the gpages mentioned in device
> tree by the platform. Are we trying to support 16GB pages just from
> any memory without platform notification through DT ?
>
There are two ways to specify gpages, one via device tree which is used
only in case of pseries and other hugepagesz=size hugepags=no-of-hugepages.
-aneesh
next prev parent reply other threads:[~2017-05-17 6:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-16 9:24 [PATCH] powerpc/mm/hugetlb: Add support for reserving gigantic huge pages via kernel command line Aneesh Kumar K.V
2017-05-17 5:01 ` Anshuman Khandual
2017-05-17 6:59 ` Aneesh Kumar K.V [this message]
2017-05-18 13:04 ` Anshuman Khandual
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=ae83b995-5f14-2c1d-3815-0816f0dc8f02@linux.vnet.ibm.com \
--to=aneesh.kumar@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=khandual@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
/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).