]> Pileus Git - ~andy/linux/commit
[ARM] 5450/1: Flush only the needed range when unmapping a VMA
authorAaro Koskinen <aaro.koskinen@nokia.com>
Tue, 14 Apr 2009 12:07:35 +0000 (13:07 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 15 Apr 2009 09:01:02 +0000 (10:01 +0100)
commit7fccfc00c003c855936970facdbb667bae9dbe9a
tree73c486c5db1c042dba8d507655c5176742bbb9ca
parent41609ff43005de11dadfb0ccadb344f0e2966829
[ARM] 5450/1: Flush only the needed range when unmapping a VMA

When unmapping N pages (e.g. shared memory) the amount of TLB flushes
done can be (N*PAGE_SIZE/ZAP_BLOCK_SIZE)*N although it should be N at
maximum. With PREEMPT kernel ZAP_BLOCK_SIZE is 8 pages, so there is a
noticeable performance penalty when unmapping a large VMA and the system
is spending its time in flush_tlb_range().

The problem is that tlb_end_vma() is always flushing the full VMA
range. The subrange that needs to be flushed can be calculated by
tlb_remove_tlb_entry(). This approach was suggested by Hugh Dickins,
and is also used by other arches.

The speed increase is roughly 3x for 8M mappings and for larger mappings
even more.

Signed-off-by: Aaro Koskinen <Aaro.Koskinen@nokia.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/tlb.h