From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Schwidefsky Subject: Re: [PATCH 11/20] mm, s390: Convert to use generic mmu_gather Date: Thu, 28 Jun 2012 09:13:42 +0200 Message-ID: <20120628091342.54d4f4eb@de.ibm.com> References: <20120627211540.459910855@chello.nl> <20120627212831.353649870@chello.nl> <1340835199.10063.76.camel@twins> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1340835199.10063.76.camel@twins> Sender: owner-linux-mm@kvack.org To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, Thomas Gleixner , Ingo Molnar , akpm@linux-foundation.org, Linus Torvalds , Rik van Riel , Hugh Dickins , Mel Gorman , Nick Piggin , Alex Shi , "Nikunj A. Dadhania" , Konrad Rzeszutek Wilk , Benjamin Herrenschmidt , David Miller , Russell King , Catalin Marinas , Chris Metcalf , Tony Luck , Paul Mundt , Jeff Dike List-Id: linux-arch.vger.kernel.org On Thu, 28 Jun 2012 00:13:19 +0200 Peter Zijlstra wrote: > On Wed, 2012-06-27 at 23:15 +0200, Peter Zijlstra wrote: > > > > S390 doesn't need a TLB flush after ptep_get_and_clear_full() and > > before __tlb_remove_page() because its ptep_get_and_clear*() family > > already does a full TLB invalidate. Therefore force it to use > > tlb_fast_mode. > > On that.. ptep_get_and_clear() says: > > /* > * This is hard to understand. ptep_get_and_clear and ptep_clear_flush > * both clear the TLB for the unmapped pte. The reason is that > * ptep_get_and_clear is used in common code (e.g. change_pte_range) > * to modify an active pte. The sequence is > * 1) ptep_get_and_clear > * 2) set_pte_at > * 3) flush_tlb_range > * On s390 the tlb needs to get flushed with the modification of the pte > * if the pte is active. The only way how this can be implemented is to > * have ptep_get_and_clear do the tlb flush. In exchange flush_tlb_range > * is a nop. > */ > > I think there is another way, arch_{enter,leave}_lazy_mmu_mode() seems > to wrap these sites so you can do as SPARC64 and PPC do and batch > through there. > > That should save a number of TLB invalidates.. Unfortunately that is not good enough. The point is that a pte that can be referenced by another cpu may not be modified without using one of the special instructions that flushes the TLBs on all cpu at the same time. It really is one pte at a time if more than one cpu attached a particular mm. -- blue skies, Martin. "Reality continues to ruin my life." - Calvin. -- 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