All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@qumranet.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: Robin Holt <holt@sgi.com>, Avi Kivity <avi@qumranet.com>,
	Izik Eidus <izike@qumranet.com>,
	kvm-devel@lists.sourceforge.net,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	steiner@sgi.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, daniel.blueman@quadrics.com
Subject: Re: [PATCH] mmu notifiers #v5
Date: Tue, 5 Feb 2008 23:26:58 +0100	[thread overview]
Message-ID: <20080205222657.GG7441@v2.random> (raw)
In-Reply-To: <Pine.LNX.4.64.0802051400200.14665@schroedinger.engr.sgi.com>

On Tue, Feb 05, 2008 at 02:06:23PM -0800, Christoph Lameter wrote:
> On Tue, 5 Feb 2008, Andrea Arcangeli wrote:
> 
> > On Tue, Feb 05, 2008 at 10:17:41AM -0800, Christoph Lameter wrote:
> > > The other approach will not have any remote ptes at that point. Why would 
> > > there be a coherency issue?
> > 
> > It never happens that two threads writes to two different physical
> > pages by working on the same process virtual address. This is an issue
> > only for KVM which is probably ok with it but certainly you can't
> > consider the dependency on the page-pin less fragile or less complex
> > than my PT lock approach.
> 
> 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.

Avoid the PT lock? The PT lock has to be taken anyway by the linux
VM.

"holding off new references until _end" = per-range mutex less scalar
and more expensive than the PT lock that has to be taken anyway.

> As I said the implementation is up to the caller. Not sure what 
> XPmem is using there but then XPmem is not using follow_page. The GRU 
> would be using a lightway way of locking not rbtrees.

"lightway way of locking" = mm-wide-mutex (not necessary at all if we
take advantage of the per-pte-scalar PT lock that has to be taken
anyway like in my patch)

> Maybe that is true for KVM but certainly not true for the GRU. The GRU is 
> designed to manage several petabytes of memory that may be mapped by a 
> series of Linux instances. If a process only maps a small chunk of 4 
> Gigabytes then we already have to deal with 1 mio callbacks.

KVM is also going to map a lot of stuff, but mapping involves mmap,
munmap/mremap/mprotect not. The size of mmap is irrelevant in both
approaches. optimizing do_exit by making the tlb-miss runtime slower
doesn't sound great to me and that's your patch does if you force GRU
to use it.

WARNING: multiple messages have this Message-ID (diff)
From: Andrea Arcangeli <andrea-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Christoph Lameter <clameter-sJ/iWh9BUns@public.gmane.org>
Cc: Peter Zijlstra
	<a.p.zijlstra-/NLkJaSkS4VmR6Xm/wNWPw@public.gmane.org>,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
	steiner-sJ/iWh9BUns@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>,
	kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	daniel.blueman-xqY44rlHlBpWk0Htik3J/w@public.gmane.org,
	Robin Holt <holt-sJ/iWh9BUns@public.gmane.org>
Subject: Re: [PATCH] mmu notifiers #v5
Date: Tue, 5 Feb 2008 23:26:58 +0100	[thread overview]
Message-ID: <20080205222657.GG7441@v2.random> (raw)
In-Reply-To: <Pine.LNX.4.64.0802051400200.14665-RYO/mD75kfhx2SFC9UQUAuF7EQX82lMiAL8bYrjMMd8@public.gmane.org>

On Tue, Feb 05, 2008 at 02:06:23PM -0800, Christoph Lameter wrote:
> On Tue, 5 Feb 2008, Andrea Arcangeli wrote:
> 
> > On Tue, Feb 05, 2008 at 10:17:41AM -0800, Christoph Lameter wrote:
> > > The other approach will not have any remote ptes at that point. Why would 
> > > there be a coherency issue?
> > 
> > It never happens that two threads writes to two different physical
> > pages by working on the same process virtual address. This is an issue
> > only for KVM which is probably ok with it but certainly you can't
> > consider the dependency on the page-pin less fragile or less complex
> > than my PT lock approach.
> 
> 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.

Avoid the PT lock? The PT lock has to be taken anyway by the linux
VM.

"holding off new references until _end" = per-range mutex less scalar
and more expensive than the PT lock that has to be taken anyway.

> As I said the implementation is up to the caller. Not sure what 
> XPmem is using there but then XPmem is not using follow_page. The GRU 
> would be using a lightway way of locking not rbtrees.

"lightway way of locking" = mm-wide-mutex (not necessary at all if we
take advantage of the per-pte-scalar PT lock that has to be taken
anyway like in my patch)

> Maybe that is true for KVM but certainly not true for the GRU. The GRU is 
> designed to manage several petabytes of memory that may be mapped by a 
> series of Linux instances. If a process only maps a small chunk of 4 
> Gigabytes then we already have to deal with 1 mio callbacks.

KVM is also going to map a lot of stuff, but mapping involves mmap,
munmap/mremap/mprotect not. The size of mmap is irrelevant in both
approaches. optimizing do_exit by making the tlb-miss runtime slower
doesn't sound great to me and that's your patch does if you force GRU
to use it.

-------------------------------------------------------------------------
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/

WARNING: multiple messages have this Message-ID (diff)
From: Andrea Arcangeli <andrea@qumranet.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: Robin Holt <holt@sgi.com>, Avi Kivity <avi@qumranet.com>,
	Izik Eidus <izike@qumranet.com>,
	kvm-devel@lists.sourceforge.net,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	steiner@sgi.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, daniel.blueman@quadrics.com
Subject: Re: [PATCH] mmu notifiers #v5
Date: Tue, 5 Feb 2008 23:26:58 +0100	[thread overview]
Message-ID: <20080205222657.GG7441@v2.random> (raw)
In-Reply-To: <Pine.LNX.4.64.0802051400200.14665@schroedinger.engr.sgi.com>

On Tue, Feb 05, 2008 at 02:06:23PM -0800, Christoph Lameter wrote:
> On Tue, 5 Feb 2008, Andrea Arcangeli wrote:
> 
> > On Tue, Feb 05, 2008 at 10:17:41AM -0800, Christoph Lameter wrote:
> > > The other approach will not have any remote ptes at that point. Why would 
> > > there be a coherency issue?
> > 
> > It never happens that two threads writes to two different physical
> > pages by working on the same process virtual address. This is an issue
> > only for KVM which is probably ok with it but certainly you can't
> > consider the dependency on the page-pin less fragile or less complex
> > than my PT lock approach.
> 
> 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.

Avoid the PT lock? The PT lock has to be taken anyway by the linux
VM.

"holding off new references until _end" = per-range mutex less scalar
and more expensive than the PT lock that has to be taken anyway.

> As I said the implementation is up to the caller. Not sure what 
> XPmem is using there but then XPmem is not using follow_page. The GRU 
> would be using a lightway way of locking not rbtrees.

"lightway way of locking" = mm-wide-mutex (not necessary at all if we
take advantage of the per-pte-scalar PT lock that has to be taken
anyway like in my patch)

> Maybe that is true for KVM but certainly not true for the GRU. The GRU is 
> designed to manage several petabytes of memory that may be mapped by a 
> series of Linux instances. If a process only maps a small chunk of 4 
> Gigabytes then we already have to deal with 1 mio callbacks.

KVM is also going to map a lot of stuff, but mapping involves mmap,
munmap/mremap/mprotect not. The size of mmap is irrelevant in both
approaches. optimizing do_exit by making the tlb-miss runtime slower
doesn't sound great to me and that's your patch does if you force GRU
to use it.

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2008-02-05 22:27 UTC|newest]

Thread overview: 181+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-31  4:57 [patch 0/3] [RFC] MMU Notifiers V4 Christoph Lameter
2008-01-31  4:57 ` Christoph Lameter
2008-01-31  4:57 ` [patch 1/3] mmu_notifier: Core code Christoph Lameter
2008-01-31  4:57   ` Christoph Lameter
2008-02-01  1:56   ` Jack Steiner
2008-02-01  1:56     ` Jack Steiner
2008-02-01  1:56     ` Jack Steiner
2008-02-01  2:24     ` Robin Holt
2008-02-01  2:24       ` Robin Holt
2008-02-01  2:24       ` Robin Holt
2008-02-01  2:37       ` Jack Steiner
2008-02-01  2:37         ` Jack Steiner
2008-02-01  2:37         ` Jack Steiner
2008-02-01  2:39         ` Christoph Lameter
2008-02-01  2:39           ` Christoph Lameter
2008-02-01  2:39           ` Christoph Lameter
2008-02-01  2:31   ` Robin Holt
2008-02-01  2:31     ` Robin Holt
2008-02-01  2:31     ` Robin Holt
2008-02-01  2:39     ` Christoph Lameter
2008-02-01  2:39       ` Christoph Lameter
2008-02-01  2:39       ` Christoph Lameter
2008-02-01  2:47       ` Robin Holt
2008-02-01  2:47         ` Robin Holt
2008-02-01  2:47         ` Robin Holt
2008-02-01  3:01         ` Christoph Lameter
2008-02-01  3:01           ` Christoph Lameter
2008-02-01  3:01           ` Christoph Lameter
2008-02-01  3:01       ` Jack Steiner
2008-02-01  3:01         ` Jack Steiner
2008-02-01  3:01         ` Jack Steiner
2008-02-01  3:03         ` Christoph Lameter
2008-02-01  3:03           ` Christoph Lameter
2008-02-01  3:03           ` Christoph Lameter
2008-02-01  3:52   ` Robin Holt
2008-02-01  3:52     ` Robin Holt
2008-02-01  3:52     ` Robin Holt
2008-02-01  3:58     ` Christoph Lameter
2008-02-01  3:58       ` Christoph Lameter
2008-02-01  3:58       ` Christoph Lameter
2008-02-01  4:15       ` Robin Holt
2008-02-01  4:15         ` Robin Holt
2008-02-01  4:15         ` Robin Holt
2008-02-03  1:33       ` Andrea Arcangeli
2008-02-03  1:33         ` Andrea Arcangeli
2008-02-03  1:33         ` Andrea Arcangeli
2008-02-04 19:13         ` Christoph Lameter
2008-02-04 19:13           ` Christoph Lameter
2008-02-04 19:13           ` Christoph Lameter
2008-01-31  4:57 ` [patch 2/3] mmu_notifier: Callbacks to invalidate address ranges Christoph Lameter
2008-01-31  4:57   ` Christoph Lameter
2008-01-31 12:31   ` Andrea Arcangeli
2008-01-31 12:31     ` Andrea Arcangeli
2008-01-31 12:31     ` Andrea Arcangeli
2008-01-31 20:07     ` Christoph Lameter
2008-01-31 20:07       ` Christoph Lameter
2008-01-31 20:07       ` Christoph Lameter
2008-01-31 22:01     ` mmu_notifier: close hole in fork Christoph Lameter
2008-01-31 22:01       ` Christoph Lameter
2008-01-31 22:01       ` Christoph Lameter
2008-01-31 22:16       ` mmu_notifier: reduce size of mm_struct if !CONFIG_MMU_NOTIFIER Christoph Lameter
2008-01-31 22:16         ` Christoph Lameter
2008-01-31 22:16         ` Christoph Lameter
2008-01-31 22:21       ` mmu_notifier: Move mmu_notifier_release up to get rid of the invalidat_all() callback Christoph Lameter
2008-01-31 22:21         ` Christoph Lameter
2008-01-31 22:21         ` Christoph Lameter
2008-02-01  0:13         ` Andrea Arcangeli
2008-02-01  0:13           ` Andrea Arcangeli
2008-02-01  0:13           ` Andrea Arcangeli
2008-02-01  1:52           ` Christoph Lameter
2008-02-01  1:52             ` Christoph Lameter
2008-02-01  1:52             ` Christoph Lameter
2008-02-01  1:57           ` mmu_notifier: invalidate_range for move_page_tables Christoph Lameter
2008-02-01  1:57             ` Christoph Lameter
2008-02-01  1:57             ` Christoph Lameter
2008-02-01  2:38             ` Robin Holt
2008-02-01  2:38               ` Robin Holt
2008-02-01  2:38               ` Robin Holt
2008-02-01  2:41               ` Christoph Lameter
2008-02-01  2:41                 ` Christoph Lameter
2008-02-01  2:41                 ` Christoph Lameter
2008-02-01  0:01       ` mmu_notifier: close hole in fork Andrea Arcangeli
2008-02-01  0:01         ` Andrea Arcangeli
2008-02-01  0:01         ` Andrea Arcangeli
2008-02-01  1:48         ` Christoph Lameter
2008-02-01  1:48           ` Christoph Lameter
2008-02-01  1:48           ` Christoph Lameter
2008-02-01  4:24   ` [patch 2/3] mmu_notifier: Callbacks to invalidate address ranges Robin Holt
2008-02-01  4:24     ` Robin Holt
2008-02-01  4:24     ` Robin Holt
2008-02-01  4:43     ` Christoph Lameter
2008-02-01  4:43       ` Christoph Lameter
2008-02-01  4:43       ` Christoph Lameter
2008-02-01 10:32       ` Robin Holt
2008-02-01 10:32         ` Robin Holt
2008-02-01 10:32         ` Robin Holt
2008-02-01 10:37         ` Robin Holt
2008-02-01 10:37           ` Robin Holt
2008-02-01 19:13         ` Christoph Lameter
2008-02-01 19:13           ` Christoph Lameter
2008-02-01 19:13           ` Christoph Lameter
2008-01-31  4:57 ` [patch 3/3] mmu_notifier: invalidate_page callbacks Christoph Lameter
2008-01-31  4:57   ` Christoph Lameter
2008-01-31 17:18 ` [PATCH] mmu notifiers #v5 Andrea Arcangeli
2008-01-31 17:18   ` Andrea Arcangeli
2008-01-31 17:18   ` Andrea Arcangeli
2008-01-31 20:18   ` Christoph Lameter
2008-01-31 20:18     ` Christoph Lameter
2008-01-31 20:18     ` Christoph Lameter
2008-01-31 23:09     ` Christoph Lameter
2008-01-31 23:09       ` Christoph Lameter
2008-01-31 23:41       ` Andrea Arcangeli
2008-01-31 23:41         ` Andrea Arcangeli
2008-01-31 23:41         ` Andrea Arcangeli
2008-02-01  1:44         ` Christoph Lameter
2008-02-01  1:44           ` Christoph Lameter
2008-02-01  1:44           ` Christoph Lameter
2008-02-01 12:09           ` Andrea Arcangeli
2008-02-01 12:09             ` Andrea Arcangeli
2008-02-01 12:09             ` Andrea Arcangeli
2008-02-01 19:23             ` Christoph Lameter
2008-02-01 19:23               ` Christoph Lameter
2008-02-01 19:23               ` Christoph Lameter
2008-02-03  2:17               ` Andrea Arcangeli
2008-02-03  2:17                 ` Andrea Arcangeli
2008-02-03  2:17                 ` Andrea Arcangeli
2008-02-03  3:14                 ` Jack Steiner
2008-02-03  3:14                   ` Jack Steiner
2008-02-03  3:14                   ` Jack Steiner
2008-02-03  3:33                   ` Andrea Arcangeli
2008-02-03  3:33                     ` Andrea Arcangeli
2008-02-03  3:33                     ` Andrea Arcangeli
2008-02-04 19:09                 ` Christoph Lameter
2008-02-04 19:09                   ` Christoph Lameter
2008-02-04 19:09                   ` Christoph Lameter
2008-02-05  5:25                   ` Andrea Arcangeli
2008-02-05  5:25                     ` Andrea Arcangeli
2008-02-05  6:11                     ` Christoph Lameter
2008-02-05  6:11                       ` Christoph Lameter
2008-02-05  6:11                       ` Christoph Lameter
2008-02-05 18:08                       ` Andrea Arcangeli
2008-02-05 18:08                         ` Andrea Arcangeli
2008-02-05 18:08                         ` Andrea Arcangeli
2008-02-05 18:17                         ` Christoph Lameter
2008-02-05 18:17                           ` Christoph Lameter
2008-02-05 18:17                           ` Christoph Lameter
2008-02-05 20:55                           ` Andrea Arcangeli
2008-02-05 20:55                             ` Andrea Arcangeli
2008-02-05 20:55                             ` Andrea Arcangeli
2008-02-05 22:06                             ` Christoph Lameter
2008-02-05 22:06                               ` Christoph Lameter
2008-02-05 22:06                               ` Christoph Lameter
2008-02-05 22:12                               ` Robin Holt
2008-02-05 22:12                                 ` Robin Holt
2008-02-05 22:12                                 ` Robin Holt
2008-02-05 22:26                               ` Andrea Arcangeli [this message]
2008-02-05 22:26                                 ` Andrea Arcangeli
2008-02-05 22:26                                 ` Andrea Arcangeli
2008-02-05 23:10                                 ` Christoph Lameter
2008-02-05 23:10                                   ` Christoph Lameter
2008-02-05 23:10                                   ` Christoph Lameter
2008-02-05 23:47                                   ` Andrea Arcangeli
2008-02-05 23:47                                     ` Andrea Arcangeli
2008-02-05 23:47                                     ` Andrea Arcangeli
2008-02-06  0:04                                     ` Christoph Lameter
2008-02-06  0:04                                       ` Christoph Lameter
2008-02-06  0:04                                       ` Christoph Lameter
2008-01-31 23:28     ` Andrea Arcangeli
2008-01-31 23:28       ` Andrea Arcangeli
2008-02-01  1:37       ` Christoph Lameter
2008-02-01  1:37         ` Christoph Lameter
2008-02-01  1:37         ` Christoph Lameter
2008-02-01  2:23         ` Robin Holt
2008-02-01  2:23           ` Robin Holt
2008-02-01  2:23           ` Robin Holt
2008-02-01  2:26           ` Christoph Lameter
2008-02-01  2:26             ` Christoph Lameter
2008-02-01  2:26             ` Christoph Lameter
2008-02-01 12:00         ` Andrea Arcangeli
2008-02-01 12:00           ` Andrea Arcangeli
2008-02-01 12:00           ` Andrea Arcangeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080205222657.GG7441@v2.random \
    --to=andrea@qumranet.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=avi@qumranet.com \
    --cc=clameter@sgi.com \
    --cc=daniel.blueman@quadrics.com \
    --cc=holt@sgi.com \
    --cc=izike@qumranet.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=steiner@sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.