TLB flush question (x86_64)

From: Arkaprava Basu
Date: Sat Sep 03 2011 - 01:48:03 EST


Hello,

I am using 2.6.31 kernel on x86_64 (with SMP configuration). I
have a confusion on a TLB flush function.
I found that the method tlb_flush_mmu (include/asm-generic/tlb.h)
, which is called by many system calls like munmap,madvise,mprotect
etc; ignores the virtual address range (start and end parameters) for
which it is called. It internally calls tlb_flush method, which on x86
gets converted to flush_tlb_mm. It seems that flush_tlb_mm flushes out
all the mappings for a given mm_struct (i.e., the whole user address
space for a process) from the tlb. Is there any particular reason why
the entire address space is flushed from the tlb while only a range of
virtual address space was supposedly required to be flushed? For
example why the method flush_tlb_range , which would have flushed
mappings belonging to a given virtual address range only could not
have been used instead of flush_tlb_mm? Is there any performance or
some other correctness related concern for not doing that?

Thanks
Arka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/