From: Aaro Koskinen Date: Tue, 14 Apr 2009 12:07:35 +0000 (+0100) Subject: [ARM] 5450/1: Flush only the needed range when unmapping a VMA X-Git-Tag: v2.6.30-rc3~61^2~9 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7fccfc00c003c855936970facdbb667bae9dbe9a;p=pandora-kernel.git [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 Signed-off-by: Russell King --- Reading git-diff-tree failed