From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752726Ab1BDUjM (ORCPT ); Fri, 4 Feb 2011 15:39:12 -0500 Received: from usmamail.tilera.com ([206.83.70.70]:10221 "EHLO USMAMAIL.TILERA.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751933Ab1BDUjK (ORCPT ); Fri, 4 Feb 2011 15:39:10 -0500 Message-ID: <4D4C63ED.6060104@tilera.com> Date: Fri, 4 Feb 2011 15:39:09 -0500 From: Chris Metcalf User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: Peter Zijlstra CC: Andrea Arcangeli , Avi Kivity , Thomas Gleixner , Rik van Riel , Ingo Molnar , , Linus Torvalds , , , , Benjamin Herrenschmidt , David Miller , Hugh Dickins , Mel Gorman , Nick Piggin , Paul McKenney , Yanmin Zhang Subject: Re: [PATCH 01/25] tile: Fix __pte_free_tlb References: <20110125173111.720927511@chello.nl> <20110125174907.220115681@chello.nl> In-Reply-To: <20110125174907.220115681@chello.nl> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/25/2011 12:31 PM, Peter Zijlstra wrote: > Tile's __pte_free_tlb() implementation makes assumptions about the > generic mmu_gather implementation, cure this ;-) I assume you will take this patch into your tree? If so: Acked-by: Chris Metcalf > [ Chris, from a quick look L2_USER_PGTABLE_PAGES is something like: > 1 << (24 - 16 + 3), which looks awefully large for an on-stack > array. ] Yes, the pte_pages[] array in this routine is 2KB currently. Currently we ship with 64KB pagesize, so the kernel stack has plenty of room. I do like that your patch removes this buffer, however, since we're currently looking into (re-)supporting 4KB pages, which would totally blow the kernel stack in this routine. > Cc: Chris Metcalf > Signed-off-by: Peter Zijlstra > --- > arch/tile/mm/pgtable.c | 15 ++------------- > 1 file changed, 2 insertions(+), 13 deletions(-) > > Index: linux-2.6/arch/tile/mm/pgtable.c > =================================================================== > --- linux-2.6.orig/arch/tile/mm/pgtable.c > +++ linux-2.6/arch/tile/mm/pgtable.c > @@ -252,19 +252,8 @@ void __pte_free_tlb(struct mmu_gather *t > int i; > > pgtable_page_dtor(pte); > - tlb->need_flush = 1; > - if (tlb_fast_mode(tlb)) { > - struct page *pte_pages[L2_USER_PGTABLE_PAGES]; > - for (i = 0; i < L2_USER_PGTABLE_PAGES; ++i) > - pte_pages[i] = pte + i; > - free_pages_and_swap_cache(pte_pages, L2_USER_PGTABLE_PAGES); > - return; > - } > - for (i = 0; i < L2_USER_PGTABLE_PAGES; ++i) { > - tlb->pages[tlb->nr++] = pte + i; > - if (tlb->nr >= FREE_PTE_NR) > - tlb_flush_mmu(tlb, 0, 0); > - } > + for (i = 0; i < L2_USER_PGTABLE_PAGES; ++i) > + tlb_remove_page(tlb, pte + i); > } > > #ifndef __tilegx__ > > -- Chris Metcalf, Tilera Corp. http://www.tilera.com From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Metcalf Subject: Re: [PATCH 01/25] tile: Fix __pte_free_tlb Date: Fri, 4 Feb 2011 15:39:09 -0500 Message-ID: <4D4C63ED.6060104@tilera.com> References: <20110125173111.720927511@chello.nl> <20110125174907.220115681@chello.nl> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20110125174907.220115681@chello.nl> Sender: owner-linux-mm@kvack.org To: Peter Zijlstra Cc: Andrea Arcangeli , Avi Kivity , 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 , Paul McKenney , Yanmin Zhang List-Id: linux-arch.vger.kernel.org On 1/25/2011 12:31 PM, Peter Zijlstra wrote: > Tile's __pte_free_tlb() implementation makes assumptions about the > generic mmu_gather implementation, cure this ;-) I assume you will take this patch into your tree? If so: Acked-by: Chris Metcalf > [ Chris, from a quick look L2_USER_PGTABLE_PAGES is something like: > 1 << (24 - 16 + 3), which looks awefully large for an on-stack > array. ] Yes, the pte_pages[] array in this routine is 2KB currently. Currently we ship with 64KB pagesize, so the kernel stack has plenty of room. I do like that your patch removes this buffer, however, since we're currently looking into (re-)supporting 4KB pages, which would totally blow the kernel stack in this routine. > Cc: Chris Metcalf > Signed-off-by: Peter Zijlstra > --- > arch/tile/mm/pgtable.c | 15 ++------------- > 1 file changed, 2 insertions(+), 13 deletions(-) > > Index: linux-2.6/arch/tile/mm/pgtable.c > =================================================================== > --- linux-2.6.orig/arch/tile/mm/pgtable.c > +++ linux-2.6/arch/tile/mm/pgtable.c > @@ -252,19 +252,8 @@ void __pte_free_tlb(struct mmu_gather *t > int i; > > pgtable_page_dtor(pte); > - tlb->need_flush = 1; > - if (tlb_fast_mode(tlb)) { > - struct page *pte_pages[L2_USER_PGTABLE_PAGES]; > - for (i = 0; i < L2_USER_PGTABLE_PAGES; ++i) > - pte_pages[i] = pte + i; > - free_pages_and_swap_cache(pte_pages, L2_USER_PGTABLE_PAGES); > - return; > - } > - for (i = 0; i < L2_USER_PGTABLE_PAGES; ++i) { > - tlb->pages[tlb->nr++] = pte + i; > - if (tlb->nr >= FREE_PTE_NR) > - tlb_flush_mmu(tlb, 0, 0); > - } > + for (i = 0; i < L2_USER_PGTABLE_PAGES; ++i) > + tlb_remove_page(tlb, pte + i); > } > > #ifndef __tilegx__ > > -- Chris Metcalf, Tilera Corp. http://www.tilera.com -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from usmamail.tilera.com ([206.83.70.70]:10221 "EHLO USMAMAIL.TILERA.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751933Ab1BDUjK (ORCPT ); Fri, 4 Feb 2011 15:39:10 -0500 Message-ID: <4D4C63ED.6060104@tilera.com> Date: Fri, 4 Feb 2011 15:39:09 -0500 From: Chris Metcalf MIME-Version: 1.0 Subject: Re: [PATCH 01/25] tile: Fix __pte_free_tlb References: <20110125173111.720927511@chello.nl> <20110125174907.220115681@chello.nl> In-Reply-To: <20110125174907.220115681@chello.nl> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Peter Zijlstra Cc: Andrea Arcangeli , Avi Kivity , 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 , Paul McKenney , Yanmin Zhang Message-ID: <20110204203909.zZihk5xylJkZcFI2NiQ-L8q-aA92tfZuOXY-9n1Syi8@z> On 1/25/2011 12:31 PM, Peter Zijlstra wrote: > Tile's __pte_free_tlb() implementation makes assumptions about the > generic mmu_gather implementation, cure this ;-) I assume you will take this patch into your tree? If so: Acked-by: Chris Metcalf > [ Chris, from a quick look L2_USER_PGTABLE_PAGES is something like: > 1 << (24 - 16 + 3), which looks awefully large for an on-stack > array. ] Yes, the pte_pages[] array in this routine is 2KB currently. Currently we ship with 64KB pagesize, so the kernel stack has plenty of room. I do like that your patch removes this buffer, however, since we're currently looking into (re-)supporting 4KB pages, which would totally blow the kernel stack in this routine. > Cc: Chris Metcalf > Signed-off-by: Peter Zijlstra > --- > arch/tile/mm/pgtable.c | 15 ++------------- > 1 file changed, 2 insertions(+), 13 deletions(-) > > Index: linux-2.6/arch/tile/mm/pgtable.c > =================================================================== > --- linux-2.6.orig/arch/tile/mm/pgtable.c > +++ linux-2.6/arch/tile/mm/pgtable.c > @@ -252,19 +252,8 @@ void __pte_free_tlb(struct mmu_gather *t > int i; > > pgtable_page_dtor(pte); > - tlb->need_flush = 1; > - if (tlb_fast_mode(tlb)) { > - struct page *pte_pages[L2_USER_PGTABLE_PAGES]; > - for (i = 0; i < L2_USER_PGTABLE_PAGES; ++i) > - pte_pages[i] = pte + i; > - free_pages_and_swap_cache(pte_pages, L2_USER_PGTABLE_PAGES); > - return; > - } > - for (i = 0; i < L2_USER_PGTABLE_PAGES; ++i) { > - tlb->pages[tlb->nr++] = pte + i; > - if (tlb->nr >= FREE_PTE_NR) > - tlb_flush_mmu(tlb, 0, 0); > - } > + for (i = 0; i < L2_USER_PGTABLE_PAGES; ++i) > + tlb_remove_page(tlb, pte + i); > } > > #ifndef __tilegx__ > > -- Chris Metcalf, Tilera Corp. http://www.tilera.com