From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753920Ab0K2Urt (ORCPT ); Mon, 29 Nov 2010 15:47:49 -0500 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 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 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 X-Mailer: Evolution 2.30.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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: > > > 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.