]> git.baikalelectronics.ru Git - kernel.git/commit
asm-generic/tlb: Track which levels of the page tables have been cleared
authorWill Deacon <will.deacon@arm.com>
Thu, 23 Aug 2018 20:01:46 +0000 (21:01 +0100)
committerWill Deacon <will.deacon@arm.com>
Tue, 4 Sep 2018 10:08:27 +0000 (11:08 +0100)
commit8ddb6a1d666eb5d8e506e717105dab6d2ee8607b
tree7c09c92c42b987a72d5c1c2410cd0918d2c76c17
parent3bf2f5cf7e2ec395a5295f5647ba1551515daab1
asm-generic/tlb: Track which levels of the page tables have been cleared

It is common for architectures with hugepage support to require only a
single TLB invalidation operation per hugepage during unmap(), rather than
iterating through the mapping at a PAGE_SIZE increment. Currently,
however, the level in the page table where the unmap() operation occurs
is not stored in the mmu_gather structure, therefore forcing
architectures to issue additional TLB invalidation operations or to give
up and over-invalidate by e.g. invalidating the entire TLB.

Ideally, we could add an interval rbtree to the mmu_gather structure,
which would allow us to associate the correct mapping granule with the
various sub-mappings within the range being invalidated. However, this
is costly in terms of book-keeping and memory management, so instead we
approximate by keeping track of the page table levels that are cleared
and provide a means to query the smallest granule required for invalidation.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
include/asm-generic/tlb.h
mm/memory.c