arm64: mm: Lazily clear pte table mappings from fixmap
With the pgtable operations abstracted into `struct pgtable_ops`, the early pgtable alloc, map and unmap operations are nicely centralized. So let's enhance the implementation to speed up the clearing of pte table mappings in the fixmap. Extend FIX_MAP so that we now have 16 slots in the fixmap dedicated for pte tables. At alloc/map time, we select the next slot in the series and map it. Or if we are at the end and no more slots are available, clear down all of the slots and start at the beginning again. Batching the clear like this means we can issue tlbis more efficiently. Due to the batching, there may still be some slots mapped at the end, so address this by adding an optional cleanup() function to `struct pgtable_ops` to handle this for us. Execution time of map_mem(), which creates the kernel linear map page tables, was measured on different machines with different RAM configs: | Apple M2 VM | Ampere Altra| Ampere Altra| Ampere Altra | VM, 16G | VM, 64G | VM, 256G | Metal, 512G ---------------|-------------|-------------|-------------|------------- | ms (%) | ms (%) | ms (%) | ms (%) ---------------|-------------|-------------|-------------|------------- before | 11 (0%) | 109 (0%) | 449 (0%) | 1257 (0%) after | 6 (-46%) | 61 (-44%) | 257 (-43%) | 838 (-33%) Signed-off-by:Ryan Roberts <ryan.roberts@arm.com> Tested-by:
Itaru Kitayama <itaru.kitayama@fujitsu.com> Tested-by:
Eric Chanudet <echanude@redhat.com>
Loading
Please register or sign in to comment