From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx173.postini.com [74.125.245.173]) by kanga.kvack.org (Postfix) with SMTP id 5E3D96B0072 for ; Thu, 25 Oct 2012 09:08:23 -0400 (EDT) Message-Id: <20121025124832.914777732@chello.nl> Date: Thu, 25 Oct 2012 14:16:23 +0200 From: Peter Zijlstra Subject: [PATCH 06/31] mm: Only flush the TLB when clearing an accessible pte References: <20121025121617.617683848@chello.nl> Content-Disposition: inline; filename=0006-mm-Only-flush-the-TLB-when-clearing-an-accessible-pt.patch Sender: owner-linux-mm@kvack.org List-ID: To: Rik van Riel , Andrea Arcangeli , Mel Gorman , Johannes Weiner , Thomas Gleixner , Linus Torvalds , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Peter Zijlstra , Ingo Molnar From: Rik van Riel If ptep_clear_flush() is called to clear a page table entry that is accessible anyway by the CPU, eg. a _PAGE_PROTNONE page table entry, there is no need to flush the TLB on remote CPUs. Signed-off-by: Rik van Riel Signed-off-by: Peter Zijlstra Cc: Linus Torvalds Cc: Andrew Morton Signed-off-by: Ingo Molnar --- mm/pgtable-generic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Index: tip/mm/pgtable-generic.c =================================================================== --- tip.orig/mm/pgtable-generic.c +++ tip/mm/pgtable-generic.c @@ -88,7 +88,8 @@ pte_t ptep_clear_flush(struct vm_area_st { pte_t pte; pte = ptep_get_and_clear((vma)->vm_mm, address, ptep); - flush_tlb_page(vma, address); + if (pte_accessible(pte)) + flush_tlb_page(vma, address); return pte; } #endif -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org