The patch titled pageattr: cache flush before tlb flush has been added to the -mm tree. Its filename is pageattr-cache-flush-before-tlb-flush.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: pageattr: cache flush before tlb flush From: Shaohua Li <shaohua.li@xxxxxxxxx> clflush uses a virtual address but cache line is physical indexed in x86. In my understanding, clflush will do some pagetable walk, so doing cache flush first should reduce some pagetable walk. Signed-off-by: Shaohua Li <shaohua.li@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- arch/x86/mm/pageattr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff -puN arch/x86/mm/pageattr.c~pageattr-cache-flush-before-tlb-flush arch/x86/mm/pageattr.c --- a/arch/x86/mm/pageattr.c~pageattr-cache-flush-before-tlb-flush +++ a/arch/x86/mm/pageattr.c @@ -168,10 +168,8 @@ static void cpa_flush_range(unsigned lon BUG_ON(irqs_disabled()); WARN_ON(PAGE_ALIGN(start) != start); - on_each_cpu(__cpa_flush_range, NULL, 1); - if (!cache) - return; + goto tlb_flush; /* * We only need to flush on one CPU, @@ -188,6 +186,9 @@ static void cpa_flush_range(unsigned lon if (pte && (pte_val(*pte) & _PAGE_PRESENT)) clflush_cache_range((void *) addr, PAGE_SIZE); } + +tlb_flush: + on_each_cpu(__cpa_flush_range, NULL, 1); } /* _ Patches currently in -mm which might be from shaohua.li@xxxxxxxxx are linux-next.patch pageattr-cache-flush-before-tlb-flush.patch rtc-cmos-strongly-avoid-hpet-emulation.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html