From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH 08/21] mm: Preemptible mmu_gather Date: Mon, 29 Nov 2010 21:47:02 +0100 Message-ID: <1291063622.32004.376.camel@laptop> References: <20101126143843.801484792@chello.nl> <20101126145410.712834114@chello.nl> <20101129115324.31cc9005.kamezawa.hiroyu@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20101129115324.31cc9005.kamezawa.hiroyu@jp.fujitsu.com> Sender: owner-linux-mm@kvack.org To: KAMEZAWA Hiroyuki 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 , Stephen Rothwell , Martin Schwidefsky , Russell King , Paul Mundt , Jeff Dike , Tony Luck List-Id: linux-arch.vger.kernel.org On Mon, 2010-11-29 at 11:53 +0900, KAMEZAWA Hiroyuki wrote: > On Fri, 26 Nov 2010 15:38:51 +0100 > Peter Zijlstra wrote: >=20 > > Make mmu_gather preemptible by using a small on stack list and use > > an option allocation to speed things up. > >=20 > > Preemptible mmu_gather is desired in general and usable once > > i_mmap_lock becomes a mutex. Doing it before the mutex conversion > > saves us from having to rework the code by moving the mmu_gather > > bits inside the i_mmap_lock. > >=20 > > Cc: Benjamin Herrenschmidt > > Cc: David Miller > > Cc: Martin Schwidefsky > > Cc: Russell King > > Cc: Paul Mundt > > Cc: Jeff Dike > > Cc: Tony Luck > > Signed-off-by: Peter Zijlstra >=20 > Reviewed-by: KAMEZAWA Hiroyuki >=20 > Interesting, Hmm, how about using the 1st freed pages as tlb->pages > rathet than calling alloc_page() ? no benefits ? We could try that, but we need to be careful there, you need to wait till after the TLB invalidate and possibly an RCU period for the page-directory pages (sparc/powerpc). So doing an optimistic allocation before the TLB invalidate seems saner. Also, see patch 20. -- 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 policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from casper.infradead.org ([85.118.1.10]:49363 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753185Ab0K2Urr convert rfc822-to-8bit (ORCPT ); Mon, 29 Nov 2010 15:47:47 -0500 Subject: Re: [PATCH 08/21] mm: Preemptible mmu_gather From: Peter Zijlstra In-Reply-To: <20101129115324.31cc9005.kamezawa.hiroyu@jp.fujitsu.com> References: <20101126143843.801484792@chello.nl> <20101126145410.712834114@chello.nl> <20101129115324.31cc9005.kamezawa.hiroyu@jp.fujitsu.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Date: Mon, 29 Nov 2010 21:47:02 +0100 Message-ID: <1291063622.32004.376.camel@laptop> Mime-Version: 1.0 Sender: linux-arch-owner@vger.kernel.org List-ID: To: KAMEZAWA Hiroyuki 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 , Stephen Rothwell , Martin Schwidefsky , Russell King , Paul Mundt , Jeff Dike , Tony Luck Message-ID: <20101129204702.vcBkN1z6rf_ox8YCM8591qGwh7ItIS1WD9rjg3c0O-k@z> On Mon, 2010-11-29 at 11:53 +0900, KAMEZAWA Hiroyuki wrote: > On Fri, 26 Nov 2010 15:38:51 +0100 > Peter Zijlstra wrote: > > > Make mmu_gather preemptible by using a small on stack list and use > > an option allocation to speed things up. > > > > Preemptible mmu_gather is desired in general and usable once > > i_mmap_lock becomes a mutex. Doing it before the mutex conversion > > saves us from having to rework the code by moving the mmu_gather > > bits inside the i_mmap_lock. > > > > Cc: Benjamin Herrenschmidt > > Cc: David Miller > > Cc: Martin Schwidefsky > > Cc: Russell King > > Cc: Paul Mundt > > Cc: Jeff Dike > > Cc: Tony Luck > > Signed-off-by: Peter Zijlstra > > Reviewed-by: KAMEZAWA Hiroyuki > > Interesting, Hmm, how about using the 1st freed pages as tlb->pages > rathet than calling alloc_page() ? no benefits ? We could try that, but we need to be careful there, you need to wait till after the TLB invalidate and possibly an RCU period for the page-directory pages (sparc/powerpc). So doing an optimistic allocation before the TLB invalidate seems saner. Also, see patch 20.