Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757128Ab1CIPkB (ORCPT ); Wed, 9 Mar 2011 10:40:01 -0500 Received: from casper.infradead.org ([85.118.1.10]:47682 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751834Ab1CIPj4 convert rfc822-to-8bit (ORCPT ); Wed, 9 Mar 2011 10:39:56 -0500 Subject: Re: [RFC][PATCH 4/6] arm, mm: Convert arm to generic tlb From: Peter Zijlstra To: Catalin Marinas Cc: Andrea Arcangeli , Thomas Gleixner , Rik van Riel , Ingo Molnar , akpm@linux-foundation.org, Linus Torvalds , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, Benjamin Herrenschmidt , David Miller , Hugh Dickins , Mel Gorman , Nick Piggin , Russell King , Chris Metcalf , Martin Schwidefsky In-Reply-To: <1299684963.19820.344.camel@e102109-lin.cambridge.arm.com> References: <20110302175928.022902359@chello.nl> <20110302180259.109909335@chello.nl> <1299683964.2308.3075.camel@twins> <1299684963.19820.344.camel@e102109-lin.cambridge.arm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Date: Wed, 09 Mar 2011 16:39:10 +0100 Message-ID: <1299685150.2308.3097.camel@twins> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2341 Lines: 49 On Wed, 2011-03-09 at 15:36 +0000, Catalin Marinas wrote: > On Wed, 2011-03-09 at 15:19 +0000, Peter Zijlstra wrote: > > On Wed, 2011-03-09 at 15:16 +0000, Catalin Marinas wrote: > > > Hi Peter, > > > > > > On 2 March 2011 17:59, Peter Zijlstra wrote: > > > > --- linux-2.6.orig/arch/arm/include/asm/tlb.h > > > > +++ linux-2.6/arch/arm/include/asm/tlb.h > > > [...] > > > > +__pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte, unsigned long addr) > > > > { > > > > pgtable_page_dtor(pte); > > > > - tlb_add_flush(tlb, addr); > > > > tlb_remove_page(tlb, pte); > > > > } > > > > > > I think we still need a tlb_track_range() call here. On the path to > > > pte_free_tlb() (for example shift_arg_pages ... free_pte_range) there > > > doesn't seem to be any code setting the tlb->start/end range. Did I > > > miss anything? > > > > Patch 3 included: > > > > -#define pte_free_tlb(tlb, ptep, address) \ > > - do { \ > > - tlb->need_flush = 1; \ > > - __pte_free_tlb(tlb, ptep, address); \ > > +#define pte_free_tlb(tlb, ptep, address) \ > > + do { \ > > + tlb->need_flush = 1; \ > > + tlb_track_range(tlb, address, pmd_addr_end(address, TASK_SIZE));\ > > + __pte_free_tlb(tlb, ptep, address); \ > > } while (0) > > OK, so the range is tracked. The only issue is that for platforms with a > folded pmd the range end would go to TASK_SIZE. In this case > pgd_addr_end() would make more sense (or something like > PTRS_PER_PTE*PAGE_SIZE). Urgh, so when pmds are folded pmd_addr_end() doesn't get to be the next biggest thing? PTRS_PER_PTE*PAGE_SIZE like things don't work since there is no guarantee addr is at the beginning of the pmd. Ok, will try and sort that out. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/