From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Christophe Leroy <christophe.leroy@c-s.fr>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Scott Wood <oss@buserror.net>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v3 5/5] powerpc/mm: Fix growth direction for hugepages mmaps with slice
Date: Wed, 24 Jan 2018 14:45:12 +0530 [thread overview]
Message-ID: <c6eff627-9d86-dab1-e91e-9ea5a98c4c55@linux.vnet.ibm.com> (raw)
In-Reply-To: <362a93307a09b521878c47a8999a39a228184293.1516783089.git.christophe.leroy@c-s.fr>
On 01/24/2018 02:32 PM, Christophe Leroy wrote:
> An application running with libhugetlbfs fails to allocate
> additional pages to HEAP due to the hugemap being done
> inconditionally as topdown mapping:
>
> mmap(0x10080000, 1572864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x40000, -1, 0) = 0x73e80000
> [...]
> mmap(0x74000000, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x40000, -1, 0x180000) = 0x73d80000
> munmap(0x73d80000, 1048576) = 0
> [...]
> mmap(0x74000000, 1572864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x40000, -1, 0x180000) = 0x73d00000
> munmap(0x73d00000, 1572864) = 0
> [...]
> mmap(0x74000000, 1572864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x40000, -1, 0x180000) = 0x73d00000
> munmap(0x73d00000, 1572864) = 0
> [...]
>
> As one can see from the above strace log, mmap() allocates further
> pages below the initial one because no space is available on top of it.
>
> This patch fixes it by requesting bottomup mapping as the non
> generic hugetlb_get_unmapped_area() does
>
> Fixes: d0f13e3c20b6f ("[POWERPC] Introduce address space "slices" ")
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> ---
> v3: Was a standalone patch before, but conflicts with this serie.
>
> arch/powerpc/mm/hugetlbpage.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
> index 79e1378ee303..368ea6b248ad 100644
> --- a/arch/powerpc/mm/hugetlbpage.c
> +++ b/arch/powerpc/mm/hugetlbpage.c
> @@ -558,7 +558,7 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
> return radix__hugetlb_get_unmapped_area(file, addr, len,
> pgoff, flags);
> #endif
> - return slice_get_unmapped_area(addr, len, flags, mmu_psize, 1);
> + return slice_get_unmapped_area(addr, len, flags, mmu_psize, 0);
> }
> #endif
Why make this change also for PPC64? Can you do this #ifdef 8xx?.You can
ideally move hugetlb_get_unmapped_area to slice.h and then make this
much simpler for 8xxx?
-aneesh
-aneesh
next prev parent reply other threads:[~2018-01-24 9:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-24 9:02 [PATCH v3 1/5] powerpc/mm: Remove intermediate bitmap copy in 'slices' Christophe Leroy
2018-01-24 9:02 ` [PATCH v3 2/5] powerpc/mm: Enhance 'slice' for supporting PPC32 Christophe Leroy
[not found] ` <87vafl18vu.fsf@linux.vnet.ibm.com>
2018-02-10 12:55 ` Christophe LEROY
2018-01-24 9:02 ` [PATCH v3 3/5] powerpc/32: Fix hugepage allocation on 8xx at hint address Christophe Leroy
2018-01-24 9:02 ` [PATCH v3 4/5] powerpc/mm: Allow up to 64 low slices Christophe Leroy
2018-01-29 6:29 ` Aneesh Kumar K.V
2018-01-29 8:56 ` Christophe LEROY
2018-02-10 12:58 ` Christophe LEROY
2018-01-24 9:02 ` [PATCH v3 5/5] powerpc/mm: Fix growth direction for hugepages mmaps with slice Christophe Leroy
2018-01-24 9:15 ` Aneesh Kumar K.V [this message]
2018-01-24 9:27 ` Christophe LEROY
2018-01-24 9:35 ` Aneesh Kumar K.V
2018-01-24 9:39 ` Christophe LEROY
2018-01-24 9:51 ` Aneesh Kumar K.V
2018-01-24 10:03 ` Christophe LEROY
2018-01-24 10:08 ` Aneesh Kumar K.V
2018-01-24 10:19 ` Christophe LEROY
2018-01-29 6:17 ` [PATCH v3 1/5] powerpc/mm: Remove intermediate bitmap copy in 'slices' Aneesh Kumar K.V
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=c6eff627-9d86-dab1-e91e-9ea5a98c4c55@linux.vnet.ibm.com \
--to=aneesh.kumar@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=christophe.leroy@c-s.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=oss@buserror.net \
--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).