From: Andrea Arcangeli <andrea@qumranet.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: Hugh Dickins <hugh@veritas.com>, 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>,
general@lists.openfabrics.org,
Steve Wise <swise@opengridcomputing.com>,
Roland Dreier <rdreier@cisco.com>,
Kanoj Sarcar <kanojsarcar@yahoo.com>,
steiner@sgi.com, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, daniel.blueman@quadrics.com,
Nick Piggin <npiggin@suse.de>
Subject: Re: EMM: disable other notifiers before register and unregister
Date: Fri, 4 Apr 2008 14:30:40 +0200 [thread overview]
Message-ID: <20080404123040.GC10185@duo.random> (raw)
In-Reply-To: <Pine.LNX.4.64.0804031215050.7480@schroedinger.engr.sgi.com>
On Thu, Apr 03, 2008 at 12:20:41PM -0700, Christoph Lameter wrote:
> On Thu, 3 Apr 2008, Andrea Arcangeli wrote:
>
> > My attempt to fix this once and for all is to walk all vmas of the
> > "mm" inside mmu_notifier_register and take all anon_vma locks and
> > i_mmap_locks in virtual address order in a row. It's ok to take those
> > inside the mmap_sem. Supposedly if anybody will ever take a double
> > lock it'll do in order too. Then I can dump all the other locking and
>
> What about concurrent mmu_notifier registrations from two mm_structs
> that have shared mappings? Isnt there a potential deadlock situation?
No, the ordering of the lock avoids that. Here a snippnet.
/*
* This operation locks against the VM for all pte/vma/mm related
* operations that could ever happen on a certain mm. This includes
* vmtruncate, try_to_unmap, and all page faults. The holder
* must not hold any mm related lock. A single task can't take more
* than one mm lock in a row or it would deadlock.
*/
So you can't do:
mm_lock(mm1);
mm_lock(mm2);
But if two different tasks run the mm_lock everything is ok. Each task
in the system can lock at most 1 mm at time.
> Well good luck. Hopefully we will get to something that works.
Looks good so far but I didn't finish it yet.
WARNING: multiple messages have this Message-ID (diff)
From: Andrea Arcangeli <andrea@qumranet.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: Nick Piggin <npiggin@suse.de>,
steiner@sgi.com, Peter Zijlstra <a.p.zijlstra@chello.nl>,
linux-mm@kvack.org, Kanoj Sarcar <kanojsarcar@yahoo.com>,
Roland Dreier <rdreier@cisco.com>,
Steve Wise <swise@opengridcomputing.com>,
linux-kernel@vger.kernel.org, Avi Kivity <avi@qumranet.com>,
kvm-devel@lists.sourceforge.net, daniel.blueman@quadrics.com,
Robin Holt <holt@sgi.com>,
general@lists.openfabrics.org, Hugh Dickins <hugh@veritas.com>
Subject: Re: EMM: disable other notifiers before register and unregister
Date: Fri, 4 Apr 2008 14:30:40 +0200 [thread overview]
Message-ID: <20080404123040.GC10185@duo.random> (raw)
In-Reply-To: <Pine.LNX.4.64.0804031215050.7480@schroedinger.engr.sgi.com>
On Thu, Apr 03, 2008 at 12:20:41PM -0700, Christoph Lameter wrote:
> On Thu, 3 Apr 2008, Andrea Arcangeli wrote:
>
> > My attempt to fix this once and for all is to walk all vmas of the
> > "mm" inside mmu_notifier_register and take all anon_vma locks and
> > i_mmap_locks in virtual address order in a row. It's ok to take those
> > inside the mmap_sem. Supposedly if anybody will ever take a double
> > lock it'll do in order too. Then I can dump all the other locking and
>
> What about concurrent mmu_notifier registrations from two mm_structs
> that have shared mappings? Isnt there a potential deadlock situation?
No, the ordering of the lock avoids that. Here a snippnet.
/*
* This operation locks against the VM for all pte/vma/mm related
* operations that could ever happen on a certain mm. This includes
* vmtruncate, try_to_unmap, and all page faults. The holder
* must not hold any mm related lock. A single task can't take more
* than one mm lock in a row or it would deadlock.
*/
So you can't do:
mm_lock(mm1);
mm_lock(mm2);
But if two different tasks run the mm_lock everything is ok. Each task
in the system can lock at most 1 mm at time.
> Well good luck. Hopefully we will get to something that works.
Looks good so far but I didn't finish it yet.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
next prev parent reply other threads:[~2008-04-04 12:30 UTC|newest]
Thread overview: 93+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-01 20:55 [patch 0/9] [RFC] EMM Notifier V2 Christoph Lameter
2008-04-01 20:55 ` [ofa-general] " Christoph Lameter
2008-04-01 20:55 ` [patch 1/9] EMM Notifier: The notifier calls Christoph Lameter
2008-04-01 20:55 ` Christoph Lameter
2008-04-01 21:14 ` Peter Zijlstra
2008-04-01 21:38 ` Paul E. McKenney
2008-04-02 17:44 ` Christoph Lameter
2008-04-02 18:43 ` EMM: Fix rcu handling and spelling Christoph Lameter
2008-04-02 19:02 ` Paul E. McKenney
2008-04-02 6:49 ` [patch 1/9] EMM Notifier: The notifier calls Andrea Arcangeli
2008-04-02 6:49 ` [ofa-general] " Andrea Arcangeli
2008-04-02 10:59 ` Robin Holt
2008-04-02 10:59 ` [ofa-general] " Robin Holt
2008-04-02 11:16 ` Andrea Arcangeli
2008-04-02 11:16 ` Andrea Arcangeli
2008-04-02 14:26 ` Robin Holt
2008-04-02 17:59 ` Christoph Lameter
2008-04-02 17:59 ` [ofa-general] " Christoph Lameter
2008-04-02 19:03 ` EMM: Fixup return value handling of emm_notify() Christoph Lameter
2008-04-02 19:03 ` [ofa-general] " Christoph Lameter
2008-04-02 21:25 ` Andrea Arcangeli
2008-04-02 21:25 ` [ofa-general] " Andrea Arcangeli
2008-04-02 21:33 ` Christoph Lameter
2008-04-02 21:33 ` [ofa-general] " Christoph Lameter
2008-04-03 10:40 ` Peter Zijlstra
2008-04-03 10:40 ` [ofa-general] " Peter Zijlstra
2008-04-03 15:00 ` Andrea Arcangeli
2008-04-03 15:00 ` [ofa-general] " Andrea Arcangeli
2008-04-03 19:14 ` Christoph Lameter
2008-04-03 19:14 ` [ofa-general] " Christoph Lameter
2008-04-02 21:05 ` EMM: Require single threadedness for registration Christoph Lameter
2008-04-02 21:05 ` [ofa-general] " Christoph Lameter
2008-04-02 22:01 ` Andrea Arcangeli
2008-04-02 22:01 ` [ofa-general] " Andrea Arcangeli
2008-04-02 22:06 ` Christoph Lameter
2008-04-02 22:06 ` [ofa-general] " Christoph Lameter
2008-04-02 22:17 ` Andrea Arcangeli
2008-04-02 22:17 ` [ofa-general] " Andrea Arcangeli
2008-04-02 22:41 ` Christoph Lameter
2008-04-02 22:41 ` [ofa-general] " Christoph Lameter
2008-04-03 1:24 ` EMM: disable other notifiers before register and unregister Christoph Lameter
2008-04-03 1:24 ` Christoph Lameter
2008-04-03 10:40 ` Peter Zijlstra
2008-04-03 10:40 ` [ofa-general] " Peter Zijlstra
2008-04-03 15:29 ` Andrea Arcangeli
2008-04-03 19:20 ` Christoph Lameter
2008-04-03 19:20 ` [ofa-general] " Christoph Lameter
2008-04-03 20:23 ` Christoph Lameter
2008-04-04 12:30 ` Andrea Arcangeli [this message]
2008-04-04 12:30 ` Andrea Arcangeli
2008-04-04 20:20 ` [PATCH] mmu notifier #v11 Andrea Arcangeli
2008-04-04 20:20 ` [ofa-general] " Andrea Arcangeli
2008-04-04 22:06 ` Christoph Lameter
2008-04-05 0:23 ` Andrea Arcangeli
2008-04-05 0:23 ` [ofa-general] " Andrea Arcangeli
2008-04-07 5:45 ` Christoph Lameter
2008-04-07 5:45 ` Christoph Lameter
2008-04-07 6:02 ` Andrea Arcangeli
2008-04-07 6:02 ` [ofa-general] " Andrea Arcangeli
2008-04-02 21:53 ` [patch 1/9] EMM Notifier: The notifier calls Andrea Arcangeli
2008-04-02 21:53 ` [ofa-general] " Andrea Arcangeli
2008-04-02 21:54 ` Christoph Lameter
2008-04-02 21:54 ` [ofa-general] " Christoph Lameter
2008-04-02 22:09 ` Andrea Arcangeli
2008-04-02 22:09 ` [ofa-general] " Andrea Arcangeli
2008-04-02 23:04 ` Christoph Lameter
2008-04-02 23:04 ` [ofa-general] " Christoph Lameter
2008-04-01 20:55 ` [patch 2/9] Move tlb flushing into free_pgtables Christoph Lameter
2008-04-01 20:55 ` [ofa-general] " Christoph Lameter
2008-04-01 20:55 ` [patch 3/9] Convert i_mmap_lock to i_mmap_sem Christoph Lameter
2008-04-01 20:55 ` [ofa-general] " Christoph Lameter
2008-04-01 20:55 ` [patch 4/9] Remove tlb pointer from the parameters of unmap vmas Christoph Lameter
2008-04-01 20:55 ` Christoph Lameter
2008-04-01 20:55 ` [patch 5/9] Convert anon_vma lock to rw_sem and refcount Christoph Lameter
2008-04-01 20:55 ` Christoph Lameter
2008-04-02 17:50 ` Andrea Arcangeli
2008-04-02 17:50 ` Andrea Arcangeli
2008-04-02 18:15 ` Christoph Lameter
2008-04-02 18:15 ` Christoph Lameter
2008-04-02 21:56 ` Andrea Arcangeli
2008-04-02 21:56 ` [ofa-general] " Andrea Arcangeli
2008-04-02 21:56 ` Christoph Lameter
2008-04-02 21:56 ` [ofa-general] " Christoph Lameter
2008-04-02 22:12 ` Andrea Arcangeli
2008-04-02 22:12 ` [ofa-general] " Andrea Arcangeli
2008-04-01 20:55 ` [patch 6/9] This patch exports zap_page_range as it is needed by XPMEM Christoph Lameter
2008-04-01 20:55 ` Christoph Lameter
2008-04-01 20:55 ` [patch 7/9] Locking rules for taking multiple mmap_sem locks Christoph Lameter
2008-04-01 20:55 ` Christoph Lameter
2008-04-01 20:55 ` [patch 8/9] XPMEM: The device driver Christoph Lameter
2008-04-01 20:55 ` Christoph Lameter
2008-04-01 20:55 ` [patch 9/9] XPMEM: Simple example Christoph Lameter
2008-04-01 20:55 ` Christoph Lameter
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=20080404123040.GC10185@duo.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=general@lists.openfabrics.org \
--cc=holt@sgi.com \
--cc=hugh@veritas.com \
--cc=izike@qumranet.com \
--cc=kanojsarcar@yahoo.com \
--cc=kvm-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=npiggin@suse.de \
--cc=rdreier@cisco.com \
--cc=steiner@sgi.com \
--cc=swise@opengridcomputing.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.