linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	aneesh.kumar@linux.ibm.com
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] powerpc/8xx: Merge 8M hugepage slice and basepage slice
Date: Fri, 14 Feb 2020 09:37:06 +0100	[thread overview]
Message-ID: <70082b0a-00c4-4d53-8846-ceab9a626328@c-s.fr> (raw)
In-Reply-To: <4ad03047ac61bfbdad3edb92542dedc807fc3cf4.1581011735.git.christophe.leroy@c-s.fr>



Le 06/02/2020 à 20:21, Christophe Leroy a écrit :
> On 8xx, slices are used because hugepages (512k or 8M) and small
> pages (4k or 16k) cannot share the same PGD entry. However, as 8M
> entirely covers two PGD entries (One PGD entry covers 4M), there
> will implicitely be no conflict between 8M pages and any other size.
> So 8M is compatible with the basepage size as well.
> 
> Remove the struct slice_mask mask_8m from mm_context_t and make
> vma_mmu_pagesize() rely on vma_kernel_pagesize() as the base
> slice can now host several sizes.

I'm working on getting rid of CONFIG_PPC_MM_SLICES on the 8xx, so this 
little series is probably not worth merging.

Christophe

> 
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> ---
>   arch/powerpc/include/asm/nohash/32/mmu-8xx.h | 7 ++-----
>   arch/powerpc/mm/hugetlbpage.c                | 3 ++-
>   2 files changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/nohash/32/mmu-8xx.h b/arch/powerpc/include/asm/nohash/32/mmu-8xx.h
> index 76af5b0cb16e..54f7f3362edb 100644
> --- a/arch/powerpc/include/asm/nohash/32/mmu-8xx.h
> +++ b/arch/powerpc/include/asm/nohash/32/mmu-8xx.h
> @@ -215,9 +215,8 @@ typedef struct {
>   	unsigned char low_slices_psize[SLICE_ARRAY_SIZE];
>   	unsigned char high_slices_psize[0];
>   	unsigned long slb_addr_limit;
> -	struct slice_mask mask_base_psize; /* 4k or 16k */
> +	struct slice_mask mask_base_psize; /* 4k or 16k or 8M */
>   	struct slice_mask mask_512k;
> -	struct slice_mask mask_8m;
>   #endif
>   	void *pte_frag;
>   } mm_context_t;
> @@ -257,10 +256,8 @@ static inline struct slice_mask *slice_mask_for_size(mm_context_t *ctx, int psiz
>   {
>   	if (psize == MMU_PAGE_512K)
>   		return &ctx->mask_512k;
> -	if (psize == MMU_PAGE_8M)
> -		return &ctx->mask_8m;
>   
> -	BUG_ON(psize != mmu_virtual_psize);
> +	BUG_ON(psize != mmu_virtual_psize && psize != MMU_PAGE_8M);
>   
>   	return &ctx->mask_base_psize;
>   }
> diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
> index edf511c2a30a..0b4ab741bf09 100644
> --- a/arch/powerpc/mm/hugetlbpage.c
> +++ b/arch/powerpc/mm/hugetlbpage.c
> @@ -551,7 +551,8 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
>   unsigned long vma_mmu_pagesize(struct vm_area_struct *vma)
>   {
>   	/* With radix we don't use slice, so derive it from vma*/
> -	if (IS_ENABLED(CONFIG_PPC_MM_SLICES) && !radix_enabled()) {
> +	if (IS_ENABLED(CONFIG_PPC_MM_SLICES) && !IS_ENABLED(CONFIG_PPC_8xx) &&
> +	    !radix_enabled()) {
>   		unsigned int psize = get_slice_psize(vma->vm_mm, vma->vm_start);
>   
>   		return 1UL << mmu_psize_to_shift(psize);
> 

      parent reply	other threads:[~2020-02-14  8:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-06 19:21 [PATCH 1/2] powerpc/8xx: Merge 8M hugepage slice and basepage slice Christophe Leroy
2020-02-06 19:21 ` [PATCH 2/2] powerpc/8xx: Make 8M hugepages also compatible with the 512K pages slice Christophe Leroy
2020-02-14  8:37 ` Christophe Leroy [this message]

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=70082b0a-00c4-4d53-8846-ceab9a626328@c-s.fr \
    --to=christophe.leroy@c-s.fr \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --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).