linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Alex Ghiti <alex@ghiti.fr>
To: Mike Kravetz <mike.kravetz@oracle.com>,
	Alexandre Ghiti <aghiti@upmem.com>,
	palmer@sifive.com
Cc: aou@eecs.berkeley.edu, catalin.marinas@arm.com,
	ndesaulniers@google.com, mingo@kernel.org, atish.patra@wdc.com,
	linux-riscv@lists.infradead.org, akpm@linux-foundation.org
Subject: Re: [PATCH 0/3] Hugetlbfs support for riscv
Date: Thu, 10 Jan 2019 09:09:26 +0100	[thread overview]
Message-ID: <6c5bccf0-f185-4db4-96fc-5439bf8f6330@ghiti.fr> (raw)
In-Reply-To: <91664ec7-d148-1c0a-8d1a-82815c5c7f6a@oracle.com>


On 1/9/19 7:23 PM, Mike Kravetz wrote:
> On 12/9/18 10:21 PM, Alexandre Ghiti wrote:
>> This series introduces hugetlbfs support for both riscv 32/64. Riscv32
>> is architecturally limited to huge pages of size 4MB whereas riscv64 has
>> 2MB/1G huge pages support. Transparent huge page support is not
>> implemented here, I will submit another series later.
> Thanks for doing this.
>
> Since patches only touch riscv specific code, I did not look too closely
> and do not feel qualified to offer an opinion as to whether they are correct
> for the architecture.
>
> With that said, the patches do look reasonable with a few comments below.
>
>> CMA or (MEMORY_ISOLATION && COMPACTION) must be enabled so that boot
>> reserved gigantic pages can be freed: indeed, one can reduce the number
>> of huge pages by calling free_gigantic_pages which in turn calls
>> free_contig_range, defined only with those configs defined.
>> However I don't see any strong dependency between free_contig_range
>> and those configs, maybe we could allow hugetlbfs users to free boot
>> reserved hugepages without those configs activated, I will propose
>> something if Mike Kravetz agrees.
> Yes, that should be modified.  I think it would be a simple matter of moving
> free_contig_range out of that ifdef block.  If you would like, I can submit
> a patch for that.


I think there is more to do: free_gigantic_page is only defined with
ARCH_HAS_GIGANTIC_PAGE which in turn is only defined with
CMA || (MEMORY_ISOLATION && COMPACTION). Moreover, if
ARCH_HAS_GIGANTIC_PAGE is not defined, gigantic_page_supported
will return false and then function like update_and_free_page will
not reach the call to free_gigantic_page...etc. I will send you a patch
when I have fixed all of that :)


> Somewhat related, I do not think your patches enable dynamic allocation of
> gigantic pages.  Not sure if that was an oversight or conscious decision.
> I am not sure this is a highly used feature, but if you can do it on riscv
> then why not?

I'm not sure to understand: do you mean picking an already allocated
gigantic page or really allocating it with alloc_gigantic_page ? Or
something else ?


> Another 'missing feature' in your patches is PMD sharing.  This feature if
> only of value for BIG shared hugetlbfs mappings.  DB folks like it.  As
> mentioned above, I do not know much about riscv so I do not know if this
> might be of use to potential users.


Thanks for that, I was unaware of that feature, I will take a look.


>> - libhugetlbfs testsuite on riscv64/1G:
>>    - brk_near_huge triggers an assert in malloc.c, does not on x86.
>>    - mmap-gettest, mmap-cow: testsuite passes the number of default free
>>      pages as parameters and then fails for 1G which is not the default.
>>      Otherwise succeeds when given the right number of pages.
>>    - map_high_truncate_2 fails on x86 too: 0x60000000 is not 1G aligned
>>      and fails at line 694 of fs/hugetlbfs/inode.c.
>>    - heapshrink on 1G fails on x86 too, not investigated.
>>    - counters.sh on 1G fails on x86 too: alloc_surplus_huge_page returns
>>      NULL in case of gigantic pages.
>>    - icache-hygiene succeeds after patch #3 of this series which lowers
>>      the base address of mmap.
>>    - fallocate_stress.sh on 1G never ends, on x86 too, not investigated.
> In general, libhugetlbfs tests seem to have issues with anything besides
> default huge page size.  You encountered that and noted that tests break
> for 1G pages on x86 as well.  Cleaning all that up has been on my todo list
> for years, but there always seems to be something of higher priority. :(
>
>

No problem, running the testsuite on x86 was quite simple anyway :)

Thanks Mike for your feedback,

Alex



_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  parent reply	other threads:[~2019-01-10  8:11 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-10  6:21 [PATCH 0/3] Hugetlbfs support for riscv Alexandre Ghiti
2018-12-10  6:21 ` [PATCH 1/3] riscv: Introduce huge page support for 32/64bit kernel Alexandre Ghiti
2019-01-11  6:18   ` Paul Walmsley
2019-01-11 13:58     ` Alexandre Ghiti
2019-01-15 16:11   ` Christoph Hellwig
2019-01-15 18:52     ` Alex Ghiti
2018-12-10  6:21 ` [PATCH 2/3] riscv: Fix wrong comment about task size for riscv64 Alexandre Ghiti
2019-01-15 15:58   ` Christoph Hellwig
2019-01-15 18:53     ` Alex Ghiti
2019-02-07 12:52       ` Alexandre Ghiti
2018-12-10  6:21 ` [PATCH 3/3] riscv: Adjust mmap base address at a third of task size Alexandre Ghiti
2019-01-15 16:02   ` Christoph Hellwig
2019-01-15 18:54     ` Alex Ghiti
2019-01-25 19:02       ` Palmer Dabbelt
2019-01-26  9:23         ` Alex Ghiti
2019-01-27 16:57           ` Alex Ghiti
2019-01-28 11:17             ` Alexandre Ghiti
2019-01-07 17:57 ` [PATCH 0/3] Hugetlbfs support for riscv Alex Ghiti
2019-01-07 21:52   ` Paul Walmsley
2019-01-08  9:26     ` Alexandre Ghiti
2019-01-09 18:26   ` Palmer Dabbelt
2019-01-09 19:23 ` Mike Kravetz
2019-01-09 22:15   ` Palmer Dabbelt
2019-01-10  7:33     ` Alex Ghiti
2019-01-10  8:09   ` Alex Ghiti [this message]
2019-01-10 18:28     ` Mike Kravetz
2019-01-12  1:09       ` Alex Ghiti
2019-01-15 16:04   ` Christoph Hellwig
2019-01-15 18:56     ` Alex Ghiti
2019-01-15 19:25     ` Mike Kravetz
2019-01-15 20:52       ` Christoph Hellwig
2019-01-16 13:18         ` Alexandre Ghiti

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=6c5bccf0-f185-4db4-96fc-5439bf8f6330@ghiti.fr \
    --to=alex@ghiti.fr \
    --cc=aghiti@upmem.com \
    --cc=akpm@linux-foundation.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=atish.patra@wdc.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mike.kravetz@oracle.com \
    --cc=mingo@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=palmer@sifive.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).