Re: [patch] my mmu notifiers

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Nick Piggin <npiggin@...>
Cc: <akpm@...>, Robin Holt <holt@...>, Avi Kivity <avi@...>, Izik Eidus <izike@...>, <kvm-devel@...>, Peter Zijlstra <a.p.zijlstra@...>, <general@...>, Steve Wise <swise@...>, Roland Dreier <rdreier@...>, Kanoj Sarcar <kanojsarcar@...>, <steiner@...>, <linux-kernel@...>, <linux-mm@...>, <daniel.blueman@...>, Christoph Lameter <clameter@...>
Date: Tuesday, February 19, 2008 - 9:58 am

On Tue, Feb 19, 2008 at 09:43:57AM +0100, Nick Piggin wrote:

I also tried hard to minimise the impact of the core mm/, I also
argued with Christoph that cluttering mm/ wasn't a good idea for
things like age_page that could be a 1 liner change instead of a
multiple-liner change, without any loss of flexibility or readability.


Note that in my patch the invalidate_pages in mprotect can be
trivially switched to a mprotect_pages with proper params. This will
prevent page faults completely in the secondary MMU (there will only
be tlb misses after the tlb flush just like for the core linux pte),
and it'll allow all the secondary MMU pte blocks (512/1024 at time
with my PT lock design) to be updated to have proper permissions
matching the core linux pte.


The need of the pairs is crystal clear to me: range_begin is needed
for GRU _but_only_if_ range_end is called after releasing the
reference that the VM holds on the page. _begin will flush the GRU tlb
and at the same time it will take a mutex that will block further GRU
tlb-miss-interrupts (no idea how they manange those nightmare locking,
I didn't even try to add more locking to KVM and I get away with the
fact KVM takes the pin on the page itself).

My patch calls invalidate_page/pages before the reference is released
on the page, so GRU will work fine despite lack of
range_begin. Furthermore with my patch GRU will be auto-serialized by
the PT lock w/o the need of any additional locking.


That was one of my objectives too.


Your patch should also work for KVM but it's suboptimal, my patch can
be orders of magnitude more efficient for GRU thanks to the
invalidate_pages optimization. Christoph complained about having to
call one method per pte.

And adding invalidate_range is useless unless you fully support
xpmem. You're calling invalidate_range in places that can't sleep...

No idea why xpmem needs range_begin, I perfectly understand why GRU
needs _begin with Chrisotph's patch (gru lacks the page pin) but I
dunno why xpmem needs range_begin (xpmem has the page pin so I also
think it could avoid using range_begin). Still to support GRU you need
both to call invalidate_range in places that can sleep and you need
the external rmap notifier. The moment you add xpmem into the equation
your and my clean patches become Christoph's one...
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch] my mmu notifiers, Nick Piggin, (Tue Feb 19, 4:43 am)
Re: [patch] my mmu notifiers, Andrea Arcangeli, (Tue Feb 19, 9:58 am)
Re: [patch] my mmu notifiers, Nick Piggin, (Tue Feb 19, 7:11 pm)
Re: [patch] my mmu notifiers, Christoph Lameter, (Wed Feb 27, 6:56 pm)
Re: [patch] my mmu notifiers, Robin Holt, (Tue Feb 19, 10:49 pm)
Re: [patch] my mmu notifiers, Andrea Arcangeli, (Tue Feb 19, 9:09 pm)
Re: [patch] my mmu notifiers, Nick Piggin, (Thu Feb 21, 12:47 am)
[PATCH] mmu notifiers #v6, Andrea Arcangeli, (Wed Feb 20, 6:39 am)
Re: [PATCH] mmu notifiers #v6, Nick Piggin, (Thu Feb 21, 12:54 am)
Re: [PATCH] mmu notifiers #v6, Andrea Arcangeli, (Thu Feb 21, 10:40 am)
Re: [PATCH] mmu notifiers #v6, Jack Steiner, (Thu Feb 21, 12:10 pm)
[PATCH] mmu notifiers #v7, Andrea Arcangeli, (Wed Feb 27, 3:26 pm)
[PATCH] mmu notifiers #v8, Andrea Arcangeli, (Sun Mar 2, 11:54 am)
[PATCH] mmu notifiers #v9, Andrea Arcangeli, (Mon Mar 3, 5:37 pm)
[PATCH] KVM swapping with mmu notifiers #v9, Andrea Arcangeli, (Mon Mar 3, 6:05 pm)
Re: [PATCH] KVM swapping with mmu notifiers #v9, izik eidus, (Mon Mar 3, 8:44 pm)
Re: [PATCH] KVM swapping with mmu notifiers #v9, Andrea Arcangeli, (Tue Mar 4, 9:21 am)
[RFC] Notifier for Externally Mapped Memory (EMM), Christoph Lameter, (Tue Mar 4, 3:31 am)
Re: [RFC] Notifier for Externally Mapped Memory (EMM), Andrea Arcangeli, (Tue Mar 4, 9:30 am)
Re: [RFC] Notifier for Externally Mapped Memory (EMM), Christoph Lameter, (Tue Mar 4, 3:00 pm)
Re: [RFC] Notifier for Externally Mapped Memory (EMM), Andrea Arcangeli, (Tue Mar 4, 6:20 pm)
Re: [RFC] Notifier for Externally Mapped Memory (EMM), Christoph Lameter, (Tue Mar 4, 6:35 pm)
[PATCH] 4/4 i_mmap_lock spinlock2rwsem (#v9 was 1/4), Andrea Arcangeli, (Fri Mar 7, 11:52 am)
Re: [PATCH] 4/4 i_mmap_lock spinlock2rwsem (#v9 was 1/4), Christoph Lameter, (Wed Mar 19, 5:27 pm)
Re: [PATCH] 4/4 i_mmap_lock spinlock2rwsem (#v9 was 1/4), Christoph Lameter, (Fri Mar 7, 4:03 pm)
Re: [RFC] Notifier for Externally Mapped Memory (EMM), Peter Zijlstra, (Tue Mar 4, 6:42 pm)
Re: [RFC] Notifier for Externally Mapped Memory (EMM), Christoph Lameter, (Tue Mar 4, 7:14 pm)
Re: [RFC] Notifier for Externally Mapped Memory (EMM), Peter Zijlstra, (Tue Mar 4, 7:25 pm)
Re: [RFC] Notifier for Externally Mapped Memory (EMM), Peter Zijlstra, (Tue Mar 4, 7:30 pm)
[Early draft] Conversion of i_mmap_lock to semaphore, Christoph Lameter, (Tue Mar 4, 3:34 am)
Re: [PATCH] mmu notifiers #v8, Nick Piggin, (Sun Mar 2, 11:39 pm)
Re: [PATCH] mmu notifiers #v8, Nick Piggin, (Sun Mar 2, 11:34 pm)
Re: [PATCH] mmu notifiers #v8, Christoph Lameter, (Mon Mar 3, 3:04 pm)
Re: [PATCH] mmu notifiers #v8, Nick Piggin, (Sun Mar 2, 11:33 pm)
Re: [PATCH] mmu notifiers #v8, Christoph Lameter, (Mon Mar 3, 3:03 pm)
Re: [PATCH] mmu notifiers #v8, Nick Piggin, (Sun Mar 2, 11:29 pm)
Re: [PATCH] mmu notifiers #v8, Christoph Lameter, (Mon Mar 3, 3:01 pm)
Re: [PATCH] mmu notifiers #v8, Nick Piggin, (Tue Mar 4, 8:37 pm)
Re: [PATCH] mmu notifiers #v8, Christoph Lameter, (Wed Mar 5, 2:48 pm)
Re: [PATCH] mmu notifiers #v8, Nick Piggin, (Wed Mar 5, 10:59 pm)
Re: [PATCH] mmu notifiers #v8, Andrea Arcangeli, (Mon Mar 3, 5:15 pm)
Re: [PATCH] mmu notifiers #v8, Andrea Arcangeli, (Mon Mar 3, 8:51 am)
Re: [PATCH] mmu notifiers #v8, Nick Piggin, (Mon Mar 3, 9:10 am)
Re: [PATCH] mmu notifiers #v8, Jack Steiner, (Mon Mar 3, 11:18 am)
Re: [PATCH] mmu notifiers #v8, Nick Piggin, (Mon Mar 3, 12:59 pm)
Re: [PATCH] mmu notifiers #v8, Christoph Lameter, (Mon Mar 3, 3:02 pm)
Re: [PATCH] mmu notifiers #v8, Jack Steiner, (Mon Mar 3, 2:06 pm)
Re: [PATCH] mmu notifiers #v8, Nick Piggin, (Mon Mar 3, 2:45 pm)
Re: [PATCH] mmu notifiers #v8, Jack Steiner, (Mon Mar 3, 3:15 pm)
Re: [PATCH] mmu notifiers #v8, Peter Zijlstra, (Tue Mar 4, 6:35 am)
Re: [PATCH] mmu notifiers #v8, Jack Steiner, (Tue Mar 4, 10:44 am)
Re: [PATCH] mmu notifiers #v8, Avi Kivity, (Mon Mar 3, 2:09 pm)
Re: [PATCH] mmu notifiers #v8, Jack Steiner, (Mon Mar 3, 2:23 pm)
Re: [PATCH] mmu notifiers #v8, Andrea Arcangeli, (Mon Mar 3, 9:24 am)
Re: [PATCH] mmu notifiers #v8 + xpmem, Andrea Arcangeli, (Sun Mar 2, 12:03 pm)
Re: [PATCH] mmu notifiers #v8 + xpmem, Peter Zijlstra, (Sun Mar 2, 12:23 pm)
Re: [PATCH] mmu notifiers #v7, Christoph Lameter, (Thu Feb 28, 7:05 pm)
Re: [PATCH] mmu notifiers #v7, Andrea Arcangeli, (Thu Feb 28, 8:40 pm)
Re: [PATCH] mmu notifiers #v7, Christoph Lameter, (Thu Feb 28, 9:03 pm)
Re: [PATCH] mmu notifiers #v7, Andrea Arcangeli, (Fri Feb 29, 9:09 am)
Re: [PATCH] mmu notifiers #v7, Christoph Lameter, (Fri Feb 29, 3:46 pm)
Re: [PATCH] mmu notifiers #v7, Andrew Morton, (Thu Feb 28, 8:56 pm)
Re: [PATCH] mmu notifiers #v7, Christoph Lameter, (Thu Feb 28, 3:48 pm)
Re: [PATCH] mmu notifiers #v7, Andrea Arcangeli, (Thu Feb 28, 5:52 pm)
Re: [PATCH] mmu notifiers #v7, Jack Steiner, (Thu Feb 28, 7:17 pm)
Re: [PATCH] mmu notifiers #v7, Andrea Arcangeli, (Thu Feb 28, 8:24 pm)
Re: [PATCH] mmu notifiers #v7, Christoph Lameter, (Thu Feb 28, 9:13 pm)
Re: [PATCH] mmu notifiers #v7, Christoph Lameter, (Thu Feb 28, 6:00 pm)
Re: [PATCH] mmu notifiers #v7, Christoph Lameter, (Wed Feb 27, 7:06 pm)
Re: [kvm-devel] [PATCH] mmu notifiers #v7, Andrea Arcangeli, (Wed Feb 27, 7:43 pm)
Re: [kvm-devel] [PATCH] mmu notifiers #v7, Christoph Lameter, (Wed Feb 27, 8:08 pm)
Re: [kvm-devel] [PATCH] mmu notifiers #v7, Andrea Arcangeli, (Wed Feb 27, 8:21 pm)
Re: [kvm-devel] [PATCH] mmu notifiers #v7, Christoph Lameter, (Wed Feb 27, 8:24 pm)
Re: [PATCH] mmu notifiers #v7, Peter Zijlstra, (Wed Feb 27, 4:04 pm)
Re: [PATCH] mmu notifiers #v6, Jack Steiner, (Wed Feb 20, 5:03 pm)
Re: [PATCH] mmu notifiers #v6, Robin Holt, (Wed Feb 20, 10:41 am)
Re: [PATCH] mmu notifiers #v6, Andrea Arcangeli, (Wed Feb 20, 11:34 am)
Re: [PATCH] mmu notifiers #v6, Robin Holt, (Wed Feb 20, 7:33 am)
Re: [PATCH] mmu notifiers #v6, Andrea Arcangeli, (Wed Feb 20, 8:03 am)
Re: [PATCH] mmu notifiers #v6, Nick Piggin, (Thu Feb 21, 1:02 am)
Re: [PATCH] mmu notifiers #v6, Robin Holt, (Wed Feb 20, 8:24 am)
Re: [PATCH] mmu notifiers #v6, Andrea Arcangeli, (Wed Feb 20, 8:32 am)
Re: [PATCH] mmu notifiers #v6, Robin Holt, (Wed Feb 20, 9:15 am)
[PATCH] KVM swapping (+ seqlock fix) with mmu notifiers #v6, Andrea Arcangeli, (Wed Feb 20, 6:45 am)
[PATCH] KVM swapping with mmu notifiers #v7, Andrea Arcangeli, (Wed Feb 27, 6:06 pm)
Re: [PATCH] KVM swapping with mmu notifiers #v7, izik eidus, (Thu Feb 28, 4:42 am)
Re: [patch] my mmu notifiers, Jack Steiner, (Tue Feb 19, 7:40 pm)
Re: [patch] my mmu notifiers, Nick Piggin, (Thu Feb 21, 12:42 am)
Re: [patch] my mmu notifiers, Jack Steiner, (Fri Feb 22, 12:31 pm)
Re: [patch] my mmu notifiers, Nick Piggin, (Tue Feb 19, 6:59 pm)
Re: [patch] my mmu notifiers, Christoph Lameter, (Wed Feb 27, 6:55 pm)
Re: [patch] my mmu notifiers, Andrea Arcangeli, (Tue Feb 19, 8:46 pm)
Re: [patch] my mmu notifiers, Jack Steiner, (Tue Feb 19, 10:27 am)
Re: [patch] my mmu notifiers, Christoph Lameter, (Wed Feb 27, 6:50 pm)
Re: [patch] my mmu notifiers, Nick Piggin, (Tue Feb 19, 7:04 pm)
Re: [patch] my mmu notifiers, Andrea Arcangeli, (Tue Feb 19, 8:52 pm)
Re: [patch] my mmu notifiers, Robin Holt, (Tue Feb 19, 10:46 pm)
Re: [patch] my mmu notifiers, Robin Holt, (Tue Feb 19, 7:59 am)
[patch] my mmu notifier sample driver, Nick Piggin, (Tue Feb 19, 4:44 am)