]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
powerpc/64s/radix: Improve TLB flushing for page table freeing
authorNicholas Piggin <npiggin@gmail.com>
Tue, 7 Nov 2017 07:53:09 +0000 (18:53 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 10 Nov 2017 10:33:35 +0000 (21:33 +1100)
commit0b2f5a8a792755c88bd786f89712a9fac9967b2b
tree71017cc7102dd9e5a2e76f69ac7bff27bab12ece
parentf6f27951fdf84a6edca3ea14077268ad629b57ac
powerpc/64s/radix: Improve TLB flushing for page table freeing

Unmaps that free page tables always flush the entire PID, which is
sub-optimal. Provide TLB range flushing with an additional PWC flush
that can be use for va range invalidations with PWC flush.

     Time to munmap N pages of memory including last level page table
     teardown (after mmap, touch), local invalidate:
     N           1       2      4      8     16     32     64
     vanilla  3.2us  3.3us  3.4us  3.6us  4.1us  5.2us  7.2us
     patched  1.4us  1.5us  1.7us  1.9us  2.6us  3.7us  6.2us

     Global invalidate:
     N           1       2      4      8     16      32     64
     vanilla  2.2us  2.3us  2.4us  2.6us  3.2us   4.1us  6.2us
     patched  2.1us  2.5us  3.4us  5.2us  8.7us  15.7us  6.2us

Local invalidates get much better across the board. Global ones have
the same issue where multiple tlbies for va flush do get slower than
the single tlbie to invalidate the PID. None of this test captures
the TLB benefits of avoiding killing everything.

Global gets worse, but it is brought in to line with global invalidate
for munmap()s that do not free page tables.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/tlb-radix.c