Skip to content

powerpc/8xx: Use large pages for RAM and IMMR and other improvments

Christophe Leroy linuxppc-dev lkml 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest23 patches 3 repliesIn review
  2. v723 patches 1 replySuperseded
  3. v623 patches 0 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v523 patches4 repliesSuperseded
v323 patches0 repliesSuperseded
v225 patches50 repliesSuperseded
v120 patches1 replySuperseded

Changes in v8 from the cover letter

* Don't include x_block_mapped() from compilation in arch/powerpc/mm/fsl_booke_mmu.c when CONFIG_FSL_BOOKE is not set (reported by kbuild test robot)

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/23powerpc/8xx: Save r3 all the time in DTLB miss handlerarch/powerpc/kernel/head_8xx.S+4 -90 replies
2/23powerpc/8xx: Map linear kernel RAM with 8M pagesarch/powerpc/kernel/head_8xx.S arch/powerpc/mm/8xx_mmu.c arch/powerpc/mm/Makefile +1 more+120 -140 replies
3/23powerpc: Update documentation for noltlbs kernel parameterDocumentation/kernel-parameters.txt+1 -10 replies
4/23powerpc/8xx: move setup_initial_memory_limit() into 8xx_mmu.carch/powerpc/mm/8xx_mmu.c arch/powerpc/mm/init_32.c+17 -190 replies
5/23powerpc32: Fix pte_offset_kernel() to return NULL for bad pagesarch/powerpc/include/asm/nohash/32/pgtable.h+2 -10 replies
6/23powerpc32: refactor x_mapped_by_bats() and x_mapped_by_tlbcam() togetherarch/powerpc/mm/fsl_booke_mmu.c arch/powerpc/mm/mmu_decl.h arch/powerpc/mm/pgtable_32.c +1 more+22 -420 replies
7/23powerpc/8xx: Fix vaddr for IMMR early remaparch/powerpc/include/asm/fixmap.h arch/powerpc/kernel/asm-offsets.c arch/powerpc/kernel/head_8xx.S +2 more+40 -81 reply
8/23powerpc/8xx: Map IMMR area with 512k page at a fixed addressarch/powerpc/include/asm/fixmap.h arch/powerpc/kernel/head_8xx.S arch/powerpc/mm/8xx_mmu.c +1 more+98 -32 replies
9/23powerpc/8xx: CONFIG_PIN_TLB unneeded for CONFIG_PPC_EARLY_DEBUG_CPMarch/powerpc/Kconfig.debug+0 -10 replies
10/23powerpc/8xx: map more RAM at startup when neededarch/powerpc/kernel/head_8xx.S arch/powerpc/mm/8xx_mmu.c+56 -100 replies
11/23powerpc32: Remove useless/wrong MMU:setio progress messagearch/powerpc/mm/init_32.c+0 -40 replies
12/23powerpc32: remove ioremap_basearch/powerpc/include/asm/nohash/32/pgtable.h arch/powerpc/mm/mmu_decl.h arch/powerpc/mm/pgtable_32.c +1 more+2 -140 replies
13/23powerpc/8xx: Add missing SPRN defines into reg_8xx.harch/powerpc/include/asm/mmu-8xx.h arch/powerpc/include/asm/reg_8xx.h+13 -20 replies
14/23powerpc/8xx: Handle CPU6 ERRATA directly in mtspr() macroarch/powerpc/include/asm/reg.h arch/powerpc/include/asm/reg_8xx.h+84 -00 replies
15/23powerpc/8xx: remove special handling of CPU6 errata in set_dec()arch/powerpc/include/asm/time.h arch/powerpc/kernel/head_8xx.S+1 -230 replies
16/23powerpc/8xx: rewrite set_context() in Carch/powerpc/kernel/head_8xx.S arch/powerpc/mm/8xx_mmu.c+34 -440 replies
17/23powerpc/8xx: rewrite flush_instruction_cache() in Carch/powerpc/kernel/misc_32.S arch/powerpc/mm/8xx_mmu.c+11 -60 replies
18/23powerpc: add inline functions for cache related instructionsarch/powerpc/include/asm/cache.h+19 -00 replies
19/23powerpc32: Remove clear_pages() and define clear_page() inlinearch/powerpc/include/asm/page_32.h arch/powerpc/kernel/misc_32.S arch/powerpc/kernel/ppc_ksyms_32.c+14 -200 replies
20/23powerpc32: move xxxxx_dcache_range() functions inlinearch/powerpc/include/asm/cacheflush.h arch/powerpc/kernel/misc_32.S arch/powerpc/kernel/ppc_ksyms.c+51 -680 replies
21/23powerpc: Simplify test in __dma_sync()arch/powerpc/mm/dma-noncoherent.c+1 -10 replies
22/23powerpc32: small optimisation in flush_icache_range()arch/powerpc/kernel/misc_32.S+2 -30 replies
23/23powerpc32: Remove one insn in mulhduarch/powerpc/kernel/misc_32.S+5 -60 replies

Reviews trailers per patch

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

Read the v8 thread

Cover letter [PATCH v8 00/23] powerpc/8xx: Use large pages for RAM and IMMR and other improvments

The main purpose of this patchset is to dramatically reduce the time spent in DTLB miss handler. This is achieved by:
1/ Mapping RAM with 8M pages
2/ Mapping IMMR with a fixed 512K page

On a live running system (VoIP gateway for Air Trafic Control), over a 10 minutes period (with 277s idle), we get 87 millions DTLB misses and approximatly 35 secondes are spent in DTLB handler. This represents 5.8% of the overall time and even 10.8% of the non-idle time.
Among those 87 millions DTLB misses, 15% are on user addresses and 85% are on kernel addresses. And within the kernel addresses, 93% are on addresses from the linear address space and only 7% are on addresses from the virtual address space.

Once the full patchset applied, the number of DTLB misses during the period is reduced to 11.8 millions for a duration of 5.8s, which represents 2% of the non-idle time.

This patch also includes other miscellaneous improvements:
1/ Handling of CPU6 ERRATA directly in mtspr() C macro to reduce code specific to PPC8xx
2/ Rewrite of a few non critical ASM functions in C
3/ Removal of some unused items

See related patches for details

Main changes in v3:
* Using fixmap instead of fix address for mapping IMMR

Change in v4:
* Fix of a wrong #if notified by kbuild robot in 07/23

Change in v5:
* Removed use of pmd_val() as L-value
* Adapted to match the new include files layout in Linux 4.5

Change in v6:
* Removed remaining use of pmd_val() as L-value (reported by kbuild test robot)

Change in v7:
* No change (commit error)

Change in v8:
* Don't include x_block_mapped() from compilation in arch/powerpc/mm/fsl_booke_mmu.c when CONFIG_FSL_BOOKE is not set (reported by kbuild test robot)

Christophe Leroy (23):
powerpc/8xx: Save r3 all the time in DTLB miss handler powerpc/8xx: Map linear kernel RAM with 8M pages
powerpc: Update documentation for noltlbs kernel parameter powerpc/8xx: move setup_initial_memory_limit() into 8xx_mmu.c
powerpc32: Fix pte_offset_kernel() to return NULL for bad pages
powerpc32: refactor x_mapped_by_bats() and x_mapped_by_tlbcam()
together
powerpc/8xx: Fix vaddr for IMMR early remap
powerpc/8xx: Map IMMR area with 512k page at a fixed address powerpc/8xx: CONFIG_PIN_TLB unneeded for CONFIG_PPC_EARLY_DEBUG_CPM powerpc/8xx: map more RAM at startup when needed
powerpc32: Remove useless/wrong MMU:setio progress message
powerpc32: remove ioremap_base
powerpc/8xx: Add missing SPRN defines into reg_8xx.h powerpc/8xx: Handle CPU6 ERRATA directly in mtspr() macro powerpc/8xx: remove special handling of CPU6 errata in set_dec() powerpc/8xx: rewrite set_context() in C
powerpc/8xx: rewrite flush_instruction_cache() in C
powerpc: add inline functions for cache related instructions
powerpc32: Remove clear_pages() and define clear_page() inline
powerpc32: move xxxxx_dcache_range() functions inline
powerpc: Simplify test in __dma_sync()
powerpc32: small optimisation in flush_icache_range()
powerpc32: Remove one insn in mulhdu

 Documentation/kernel-parameters.txt          |   2 +-
 arch/powerpc/Kconfig.debug                   |   1 -
 arch/powerpc/include/asm/cache.h             |  19 +++
 arch/powerpc/include/asm/cacheflush.h        |  52 ++++++-
 arch/powerpc/include/asm/fixmap.h            |  14 ++
 arch/powerpc/include/asm/mmu-8xx.h           |   4 +-
 arch/powerpc/include/asm/nohash/32/pgtable.h |   5 +-
 arch/powerpc/include/asm/page_32.h           |  17 ++-
 arch/powerpc/include/asm/reg.h               |   2 +
 arch/powerpc/include/asm/reg_8xx.h           |  93 ++++++++++++
 arch/powerpc/include/asm/time.h              |   6 +-
 arch/powerpc/kernel/asm-offsets.c            |   8 ++
 arch/powerpc/kernel/head_8xx.S               | 207 +++++++++++++++++----------
 arch/powerpc/kernel/misc_32.S                | 107 ++------------
 arch/powerpc/kernel/ppc_ksyms.c              |   2 +
 arch/powerpc/kernel/ppc_ksyms_32.c           |   1 -
 arch/powerpc/mm/8xx_mmu.c                    | 190 ++++++++++++++++++++++++
 arch/powerpc/mm/Makefile                     |   1 +
 arch/powerpc/mm/dma-noncoherent.c            |   2 +-
 arch/powerpc/mm/fsl_booke_mmu.c              |   6 +-
 arch/powerpc/mm/init_32.c                    |  23 ---
 arch/powerpc/mm/mmu_decl.h                   |  34 +++--
 arch/powerpc/mm/pgtable_32.c                 |  47 +-----
 arch/powerpc/mm/ppc_mmu_32.c                 |   4 +-
 arch/powerpc/platforms/embedded6xx/mpc10x.h  |  10 --
 arch/powerpc/sysdev/cpm_common.c             |  15 +-
 26 files changed, 585 insertions(+), 287 deletions(-)
 create mode 100644 arch/powerpc/mm/8xx_mmu.c
Signature · 1 line
2.1.0