Re: [PATCH] mmu notifiers #v6

!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: Thursday, February 21, 2008 - 10:40 am

On Thu, Feb 21, 2008 at 05:54:30AM +0100, Nick Piggin wrote:

I don't need to say you're very welcome ;).


The need to change the VM locks to fit the sleepable "mmu notifier"
needs, I think is the major reason why the sleeping patch should be a
separate config option unless you think the i_mmap_lock will benefit
the VM for its own good regardless of the sleepable mmu
notifiers. Otherwise we'll end up merging in mainline an API that can
only satisfy the needs of the "sleeping users" that are only
interested about anonymous memory. While the basic concept of the mmu
notifiers is to cover the whole user visible address space, not just
anonymous memory! Furthermore XPMEM users already asked to work on
tmpfs/MAP_SHARED too...

Originally the trick that I was trying to remove the "atomic" param,
was to defer the invalidate_range after dropping the i_mmap_lock. But
clearly in truncate we'll have no more guarantees that nor the vma nor
the MM still exists after spin_unlock(i_mmap_lock) is called... So
it's simply impossible to call the mmu notifier out of the i_mmap_lock
for truncate, and Christoph's patch looks unfixable without altering
the VM core locking. Christoph's API one-config-fits-all can't really
fit-all, but only the anonymous memory.

However if I wear a KVM hat, I cannot care less what is merged as long
as .25 will be able to fully swap reliably a virtualized guest OS ;).
This is why I'm totally willing to support any decision in favor of
anything (including your own patch that would only work for KVM) that
can be merged.


I really want suggestions on Jack's concern about issuing an
invalidate per pte entry or per-pte instead of per-range. I'll answer
that in a separate email. For KVM my patch is already close to optimal
because each single spte invalidate requires a fixed amount of work,
but for GRU a large invalidate-range would be more efficient.

To address the GRU _valid_ concern, I can create a second version of
my patch with range_begin/end instead of invalidate_pages, that still
won't support sleeping users like XPMEM but only KVM and GRU. Then
it's up to Christoph when he comes back to alter the vm locking so
that those calls can sleep too... But that will require a much bigger
change and then perhaps xpmem can share the same mmu notifiers when
the config option to make the mmu notifier sleepable is enabled. But
that part would better be incremental as it's not so obviously safe to
merge as the mmu notifier themself.
--
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)