Skip to content

RFC Remove slot tracking from linux page table

Aneesh Kumar K.V linuxppc-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest17 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17powerpc/mm: Update native_hpte_find to return hash ptearch/powerpc/mm/hash_native_64.c+40 -300 replies
2/17powerpc/pseries: Update hpte find helper to take hash valuearch/powerpc/platforms/pseries/lpar.c+17 -110 replies
3/17powerpc/ps3/mm: Add helper for finding hash pte slot using hash valuearch/powerpc/platforms/ps3/htab.c+37 -00 replies
4/17powerpc/mm: Add hash invalidate callbackarch/powerpc/include/asm/book3s/64/mmu-hash.h arch/powerpc/mm/hash_native_64.c arch/powerpc/mm/hash_utils_64.c +2 more+82 -80 replies
5/17powerpc/mm: use hash_invalidate for __kernel_map_pages()arch/powerpc/mm/hash_utils_64.c+5 -270 replies
6/17powerpc/mm: Switch flush_hash_range to not use slotarch/powerpc/mm/hash_native_64.c arch/powerpc/platforms/pseries/lpar.c+12 -290 replies
7/17powerpc/mm: Add hash updatepp callbackarch/powerpc/include/asm/book3s/64/mmu-hash.h arch/powerpc/mm/hash64_4k.c arch/powerpc/mm/hash64_64k.c +4 more+109 -270 replies
8/17powerpc/mm/hash: Don't track hash pte slot number in linux page table.arch/powerpc/include/asm/book3s/64/hash-4k.h arch/powerpc/include/asm/book3s/64/hash-64k.h arch/powerpc/include/asm/book3s/64/hash.h +12 more+50 -2210 replies
9/17powerpc/mm: Remove unused flag arg in global_invalidatesarch/powerpc/kvm/book3s_hv_rm_mmu.c+4 -50 replies
10/17powerpc/mm: Add new firmware feature HASH APIarch/powerpc/include/asm/firmware.h arch/powerpc/kvm/powerpc.c arch/powerpc/platforms/pseries/firmware.c +1 more+8 -10 replies
11/17powerpc/kvm/hash: Implement HASH_REMOVE hcallarch/powerpc/include/asm/hvcall.h arch/powerpc/include/asm/plpar_wrappers.h arch/powerpc/kvm/book3s_hv.c +2 more+138 -180 replies
12/17powerpc/kvm/hash: Implement HASH_PROTECT hcallarch/powerpc/include/asm/hvcall.h arch/powerpc/include/asm/plpar_wrappers.h arch/powerpc/kvm/book3s_hv.c +2 more+63 -230 replies
13/17powerpc/kvm/hash: Implement HASH_BULK_REMOVE hcallarch/powerpc/include/asm/book3s/64/mmu-hash.h arch/powerpc/include/asm/hvcall.h arch/powerpc/kvm/book3s_hv.c +2 more+101 -10 replies
14/17powerpc/mm/pseries: Use HASH_PROTECT hcall in guestarch/powerpc/platforms/pseries/lpar.c+6 -10 replies
15/17powerpc/mm/pseries: Use HASH_REMOVE hcall in guestarch/powerpc/platforms/pseries/lpar.c+24 -00 replies
16/17powerpc/mm/pseries: Move slot based bulk remove to helperarch/powerpc/platforms/pseries/lpar.c+31 -201 reply
17/17powerpc/mm/pseries: Use HASH_BULK_REMOVE hcall in guestarch/powerpc/platforms/pseries/lpar.c+30 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 00/17] Remove slot tracking from linux page table

Hi,

This patch series removes hash pte slot tracking in linux page table. This free up 4 bits from linux page table and brings the hash and radix linux page table closer. The series also attempt remove __real_pte_t because without slot tracking 4k subpage and 64k page , pte formats are similar.

However not tracking slot implies we search the hash group during invalidate and updatepp operations. That involves searching max 16 slots to find the matching hash page table entry. W.r.t subpages, since we don't track the validity of slots, when invalidating 64K page, we ends up calling invalidate for all subpages irrespective of whether we have taken a subpage fault or not.

W.r.t THP, we skip the above and still track slots in level deposited page table.

The patch series do have an impact, hence i am sending this as an RFC series before doing further measurements with kvm. On baremetal a kernel build gives.

Without patch:
/usr/bin/time -p make vmlinux modules > /dev/null real 270.70
user 280.23
sys 57.99

With patch
/usr/bin/time -p make vmlinux modules > /dev/null real 272.97
user 281.32
sys 61.46

That is 6% impact on system time: The real time impact is within the runtime variance.

Let me know if you think we should continue with this approach.

-aneesh

Aneesh Kumar K.V (17):
powerpc/mm: Update native_hpte_find to return hash pte powerpc/pseries: Update hpte find helper to take hash value powerpc/ps3/mm: Add helper for finding hash pte slot using hash value powerpc/mm: Add hash invalidate callback
powerpc/mm: use hash_invalidate for __kernel_map_pages() powerpc/mm: Switch flush_hash_range to not use slot powerpc/mm: Add hash updatepp callback
powerpc/mm/hash: Don't track hash pte slot number in linux page table. powerpc/mm: Remove unused flag arg in global_invalidates powerpc/mm: Add new firmware feature HASH API powerpc/kvm/hash: Implement HASH_REMOVE hcall powerpc/kvm/hash: Implement HASH_PROTECT hcall powerpc/kvm/hash: Implement HASH_BULK_REMOVE hcall powerpc/mm/pseries: Use HASH_PROTECT hcall in guest powerpc/mm/pseries: Use HASH_REMOVE hcall in guest powerpc/mm/pseries: Move slot based bulk remove to helper powerpc/mm/pseries: Use HASH_BULK_REMOVE hcall in guest

 arch/powerpc/include/asm/book3s/64/hash-4k.h       |  16 +-
 arch/powerpc/include/asm/book3s/64/hash-64k.h      |  44 +--
 arch/powerpc/include/asm/book3s/64/hash.h          |   5 +-
 arch/powerpc/include/asm/book3s/64/mmu-hash.h      |  12 +
 arch/powerpc/include/asm/book3s/64/pgtable.h       |  26 --
 arch/powerpc/include/asm/book3s/64/tlbflush-hash.h |   3 +-
 arch/powerpc/include/asm/firmware.h                |   3 +-
 arch/powerpc/include/asm/hvcall.h                  |   5 +-
 arch/powerpc/include/asm/pgtable-be-types.h        |  10 -
 arch/powerpc/include/asm/pgtable-types.h           |   9 -
 arch/powerpc/include/asm/plpar_wrappers.h          |  23 ++
 arch/powerpc/kvm/book3s_hv.c                       |   3 +
 arch/powerpc/kvm/book3s_hv_rm_mmu.c                | 306 ++++++++++++++++++---
 arch/powerpc/kvm/book3s_hv_rmhandlers.S            |   4 +
 arch/powerpc/kvm/powerpc.c                         |   4 +
 arch/powerpc/mm/dump_linuxpagetables.c             |  10 -
 arch/powerpc/mm/hash64_4k.c                        |   9 +-
 arch/powerpc/mm/hash64_64k.c                       | 108 ++------
 arch/powerpc/mm/hash_native_64.c                   | 172 ++++++++----
 arch/powerpc/mm/hash_utils_64.c                    |  65 +----
 arch/powerpc/mm/hugetlbpage-hash64.c               |  13 +-
 arch/powerpc/mm/tlb_hash64.c                       |   9 +-
 arch/powerpc/platforms/ps3/htab.c                  |  88 ++++++
 arch/powerpc/platforms/pseries/firmware.c          |   1 +
 arch/powerpc/platforms/pseries/lpar.c              | 193 ++++++++++---
 include/uapi/linux/kvm.h                           |   1 +
 26 files changed, 736 insertions(+), 406 deletions(-)
Signature · 1 line
2.13.3