From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763339AbYBEXr5 (ORCPT ); Tue, 5 Feb 2008 18:47:57 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759341AbYBEXru (ORCPT ); Tue, 5 Feb 2008 18:47:50 -0500 Received: from host36-195-149-62.serverdedicati.aruba.it ([62.149.195.36]:53146 "EHLO mx.cpushare.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756843AbYBEXru (ORCPT ); Tue, 5 Feb 2008 18:47:50 -0500 Date: Wed, 6 Feb 2008 00:47:42 +0100 From: Andrea Arcangeli To: Christoph Lameter Cc: Robin Holt , Avi Kivity , Izik Eidus , kvm-devel@lists.sourceforge.net, Peter Zijlstra , steiner@sgi.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, daniel.blueman@quadrics.com Subject: Re: [PATCH] mmu notifiers #v5 Message-ID: <20080205234742.GI7441@v2.random> References: <20080203021704.GC7185@v2.random> <20080205052525.GD7441@v2.random> <20080205180802.GE7441@v2.random> <20080205205519.GF7441@v2.random> <20080205222657.GG7441@v2.random> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 05, 2008 at 03:10:52PM -0800, Christoph Lameter wrote: > On Tue, 5 Feb 2008, Andrea Arcangeli wrote: > > > > You can avoid the page-pin and the pt lock completely by zapping the > > > mappings at _start and then holding off new references until _end. > > > > "holding off new references until _end" = per-range mutex less scalar > > and more expensive than the PT lock that has to be taken anyway. > > You can of course setup a 2M granularity lock to get the same granularity > as the pte lock. That would even work for the cases where you have to page > pin now. If you set a 2M granularity lock, the _start callback would need to do: for_each_2m_lock() mutex_lock() so you'd run zillon of mutex_lock in a row, you're the one with the million of operations argument. > The size of the mmap is relevant if you have to perform callbacks on > every mapped page that involved take mmu specific locks. That seems to be > the case with this approach. mmap should never trigger any range_start/_end callback unless it's overwriting an older mapping which is definitely not the interesting workload for those apps including kvm. > Optimizing do_exit by taking a single lock to zap all external references > instead of 1 mio callbacks somehow leads to slowdown? It can if the application runs for more than a couple of seconds, i.e. not a fork flood in which you care about do_exit speed. Keep in mind if you had 1mio invalidate_pages callback it means you previously called follow_page 1 mio of times too... From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Arcangeli Subject: Re: [PATCH] mmu notifiers #v5 Date: Wed, 6 Feb 2008 00:47:42 +0100 Message-ID: <20080205234742.GI7441@v2.random> References: <20080203021704.GC7185@v2.random> <20080205052525.GD7441@v2.random> <20080205180802.GE7441@v2.random> <20080205205519.GF7441@v2.random> <20080205222657.GG7441@v2.random> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Peter Zijlstra , linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, steiner-sJ/iWh9BUns@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Avi Kivity , kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, daniel.blueman-xqY44rlHlBpWk0Htik3J/w@public.gmane.org, Robin Holt To: Christoph Lameter Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org On Tue, Feb 05, 2008 at 03:10:52PM -0800, Christoph Lameter wrote: > On Tue, 5 Feb 2008, Andrea Arcangeli wrote: > > > > You can avoid the page-pin and the pt lock completely by zapping the > > > mappings at _start and then holding off new references until _end. > > > > "holding off new references until _end" = per-range mutex less scalar > > and more expensive than the PT lock that has to be taken anyway. > > You can of course setup a 2M granularity lock to get the same granularity > as the pte lock. That would even work for the cases where you have to page > pin now. If you set a 2M granularity lock, the _start callback would need to do: for_each_2m_lock() mutex_lock() so you'd run zillon of mutex_lock in a row, you're the one with the million of operations argument. > The size of the mmap is relevant if you have to perform callbacks on > every mapped page that involved take mmu specific locks. That seems to be > the case with this approach. mmap should never trigger any range_start/_end callback unless it's overwriting an older mapping which is definitely not the interesting workload for those apps including kvm. > Optimizing do_exit by taking a single lock to zap all external references > instead of 1 mio callbacks somehow leads to slowdown? It can if the application runs for more than a couple of seconds, i.e. not a fork flood in which you care about do_exit speed. Keep in mind if you had 1mio invalidate_pages callback it means you previously called follow_page 1 mio of times too... ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 6 Feb 2008 00:47:42 +0100 From: Andrea Arcangeli Subject: Re: [PATCH] mmu notifiers #v5 Message-ID: <20080205234742.GI7441@v2.random> References: <20080203021704.GC7185@v2.random> <20080205052525.GD7441@v2.random> <20080205180802.GE7441@v2.random> <20080205205519.GF7441@v2.random> <20080205222657.GG7441@v2.random> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org Return-Path: To: Christoph Lameter Cc: Robin Holt , Avi Kivity , Izik Eidus , kvm-devel@lists.sourceforge.net, Peter Zijlstra , steiner@sgi.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, daniel.blueman@quadrics.com List-ID: On Tue, Feb 05, 2008 at 03:10:52PM -0800, Christoph Lameter wrote: > On Tue, 5 Feb 2008, Andrea Arcangeli wrote: > > > > You can avoid the page-pin and the pt lock completely by zapping the > > > mappings at _start and then holding off new references until _end. > > > > "holding off new references until _end" = per-range mutex less scalar > > and more expensive than the PT lock that has to be taken anyway. > > You can of course setup a 2M granularity lock to get the same granularity > as the pte lock. That would even work for the cases where you have to page > pin now. If you set a 2M granularity lock, the _start callback would need to do: for_each_2m_lock() mutex_lock() so you'd run zillon of mutex_lock in a row, you're the one with the million of operations argument. > The size of the mmap is relevant if you have to perform callbacks on > every mapped page that involved take mmu specific locks. That seems to be > the case with this approach. mmap should never trigger any range_start/_end callback unless it's overwriting an older mapping which is definitely not the interesting workload for those apps including kvm. > Optimizing do_exit by taking a single lock to zap all external references > instead of 1 mio callbacks somehow leads to slowdown? It can if the application runs for more than a couple of seconds, i.e. not a fork flood in which you care about do_exit speed. Keep in mind if you had 1mio invalidate_pages callback it means you previously called follow_page 1 mio of times too... -- 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