[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080508012656.GQ8276@duo.random>
Date: Thu, 8 May 2008 03:26:56 +0200
From: Andrea Arcangeli <andrea@...ranet.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>, clameter@....com,
steiner@....com, holt@....com, npiggin@...e.de,
a.p.zijlstra@...llo.nl, kvm-devel@...ts.sourceforge.net,
kanojsarcar@...oo.com, rdreier@...co.com,
swise@...ngridcomputing.com, linux-kernel@...r.kernel.org,
avi@...ranet.com, linux-mm@...ck.org,
general@...ts.openfabrics.org, hugh@...itas.com,
rusty@...tcorp.com.au, aliguori@...ibm.com, chrisw@...hat.com,
marcelo@...ck.org, dada1@...mosbay.com, paulmck@...ibm.com
Subject: Re: [PATCH 08 of 11] anon-vma-rwsem
On Wed, May 07, 2008 at 06:02:49PM -0700, Linus Torvalds wrote:
> You replace mm_lock() with the sequence that Andrew gave you (and I
> described):
>
> spin_lock(&global_lock)
> .. get all locks UNORDERED ..
> spin_unlock(&global_lock)
>
> and you're now done. You have your "mm_lock()" (which still needs to be
> renamed - it should be a "mmu_notifier_lock()" or something like that),
> but you don't need the insane sorting. At most you apparently need a way
> to recognize duplicates (so that you don't deadlock on yourself), which
> looks like a simple bit-per-vma.
>
> The global lock doesn't protect any data structures itself - it just
> protects two of these mm_lock() functions from ABBA'ing on each other!
I thought the thing to remove was the "get all locks". I didn't
realize the major problem was only the sorting of the array.
I'll add the global lock, it's worth it as it drops the worst case
number of steps by log(65536) times. Furthermore surely two concurrent
mm_notifier_lock will run faster as it'll decrease the cacheline
collisions. Since you ask to call it mmu_notifier_lock I'll also move
it to mmu_notifier.[ch] as consequence.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists