From: Michael Ellerman <mpe@ellerman.id.au>
To: Christophe Leroy <christophe.leroy@csgroup.eu>,
Andrew Morton <akpm@linux-foundation.org>,
Jason Gunthorpe <jgg@nvidia.com>, Peter Xu <peterx@redhat.com>,
Oscar Salvador <osalvador@suse.de>,
Nicholas Piggin <npiggin@gmail.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v6 21/23] powerpc/64s: Use contiguous PMD/PUD instead of HUGEPD
Date: Tue, 02 Jul 2024 23:26:19 +1000 [thread overview]
Message-ID: <87plrwj56s.fsf@mail.lhotse> (raw)
In-Reply-To: <23f3fe9e8fe37cb164a369850d4569dddf359fdf.1719240269.git.christophe.leroy@csgroup.eu>
Christophe Leroy <christophe.leroy@csgroup.eu> writes:
> On book3s/64, the only user of hugepd is hash in 4k mode.
>
> All other setups (hash-64, radix-4, radix-64) use leaf PMD/PUD.
>
> Rework hash-4k to use contiguous PMD and PUD instead.
>
> In that setup there are only two huge page sizes: 16M and 16G.
>
> 16M sits at PMD level and 16G at PUD level.
>
> pte_update doesn't know page size, lets use the same trick as
> hpte_need_flush() to get page size from segment properties. That's
> not the most efficient way but let's do that until callers of
> pte_update() provide page size instead of just a huge flag.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
> v3:
> - Add missing pmd_leaf_size() and pud_leaf_size()
> - More cleanup in hugetlbpage_init()
> - Take a page fault when DIRTY or ACCESSED is missing on hash-4 hugepage
>
> v4: Rebased on v6.10-rc1
>
> v6: Added a WARN_ON_ONCE() in hash__pte_update() in case the pagesize is unexpected.
> ---
> arch/powerpc/include/asm/book3s/64/hash-4k.h | 15 ------
> arch/powerpc/include/asm/book3s/64/hash.h | 40 +++++++++++++---
> arch/powerpc/include/asm/book3s/64/hugetlb.h | 38 ---------------
> .../include/asm/book3s/64/pgtable-4k.h | 47 -------------------
> .../include/asm/book3s/64/pgtable-64k.h | 20 --------
> arch/powerpc/include/asm/book3s/64/pgtable.h | 22 +++++++--
> arch/powerpc/include/asm/hugetlb.h | 4 ++
> .../powerpc/include/asm/nohash/hugetlb-e500.h | 4 --
> arch/powerpc/include/asm/page.h | 8 ----
> arch/powerpc/mm/book3s64/hash_utils.c | 11 +++--
> arch/powerpc/mm/book3s64/hugetlbpage.c | 10 ++++
> arch/powerpc/mm/book3s64/pgtable.c | 12 -----
> arch/powerpc/mm/hugetlbpage.c | 26 ----------
> arch/powerpc/mm/pgtable.c | 2 +-
> arch/powerpc/platforms/Kconfig.cputype | 1 -
> 15 files changed, 74 insertions(+), 186 deletions(-)
> delete mode 100644 arch/powerpc/include/asm/book3s/64/pgtable-4k.h
This looks good to me. I've run a few tests on it and haven't seen any
issues.
I also dumped the page tables of a test program and checked they looked
sensible. And I checked that the hash insert path is actually inserting
a huge page entry (of course it is, but just to be sure).
On mainline using a hugepd page hits the first warning in
try_grab_folio() (via gup_hugepd()) and hangs the process. I haven't
seen that reported (it goes back to v6.5), so my impression is hugepd on
hash-4k is essentially unused these days.
This series is an improvement on that, so let's get it into mm-unstable
for some wider testing.
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
cheers
next prev parent reply other threads:[~2024-07-02 13:26 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-24 14:45 [PATCH v6 00/23] Reimplement huge pages without hugepd on powerpc (8xx, e500, book3s/64) Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 01/23] powerpc/64e: Remove unused IBM HTW code Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 02/23] powerpc/64e: Split out nohash Book3E 64-bit code Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 03/23] powerpc/64e: Drop E500 ifdefs in " Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 04/23] powerpc/64e: Drop MMU_FTR_TYPE_FSL_E checks " Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 05/23] powerpc/64e: Consolidate TLB miss handler patching Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 06/23] powerpc/64e: Drop unused TLB miss handlers Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 07/23] mm: Define __pte_leaf_size() to also take a PMD entry Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 08/23] mm: Provide mm_struct and address to huge_ptep_get() Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 09/23] powerpc/mm: Remove _PAGE_PSIZE Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 10/23] powerpc/mm: Fix __find_linux_pte() on 32 bits with PMD leaf entries Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 11/23] powerpc/mm: Allow hugepages without hugepd Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 12/23] powerpc/8xx: Fix size given to set_huge_pte_at() Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 13/23] powerpc/8xx: Rework support for 8M pages using contiguous PTE entries Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 14/23] powerpc/8xx: Simplify struct mmu_psize_def Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 15/23] powerpc/e500: Remove enc and ind fields from " Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 16/23] powerpc/e500: Switch to 64 bits PGD on 85xx (32 bits) Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 17/23] powerpc/e500: Encode hugepage size in PTE bits Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 18/23] powerpc/e500: Don't pre-check write access on data TLB error Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 19/23] powerpc/e500: Free r10 for FIND_PTE Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 20/23] powerpc/e500: Use contiguous PMD instead of hugepd Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 21/23] powerpc/64s: Use contiguous PMD/PUD instead of HUGEPD Christophe Leroy
2024-06-25 4:49 ` Nicholas Piggin
2024-06-25 5:20 ` LEROY Christophe
2024-06-26 1:23 ` Nicholas Piggin
2024-07-02 13:26 ` Michael Ellerman [this message]
2024-06-24 14:45 ` [PATCH v6 22/23] powerpc/mm: Remove hugepd leftovers Christophe Leroy
2024-06-24 14:45 ` [PATCH v6 23/23] mm: Remove CONFIG_ARCH_HAS_HUGEPD Christophe Leroy
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=87plrwj56s.fsf@mail.lhotse \
--to=mpe@ellerman.id.au \
--cc=akpm@linux-foundation.org \
--cc=christophe.leroy@csgroup.eu \
--cc=jgg@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=npiggin@gmail.com \
--cc=osalvador@suse.de \
--cc=peterx@redhat.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