From: Andrea Arcangeli <andrea@suse.de>
To: Rajesh Venkatasubramanian <vrajesh@umich.edu>
Cc: "Martin J. Bligh" <mbligh@aracnet.com>,
Hugh Dickins <hugh@veritas.com>,
linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] anobjrmap 9 priority mjb tree
Date: Thu, 15 Apr 2004 02:05:29 +0200 [thread overview]
Message-ID: <20040415000529.GX2150@dualathlon.random> (raw)
In-Reply-To: <Pine.LNX.4.58.0404141616530.25848@rust.engin.umich.edu>
On Wed, Apr 14, 2004 at 04:18:38PM -0400, Rajesh Venkatasubramanian wrote:
>
> This patch is another attempt at reducing the contention on i_shared_sem.
> The patch converts i_shared_sem from normal semaphore to read-write
> semaphore. The locking rules used are:
>
> 1) A prio_tree cannot be modified without holding write lock.
> 2) However, vmas can be added and removed from a vm_set list
> by just holding the read lock and a bit lock (vm_set_lock)
> in the corresponding prio_tree node.
no way, you cannot bitflip vm_flags unless you own the mmap_sem, this
patch seems very broken to me, it should randomly corrupt memory in
vma->vm_flags while racing against mprotect etc.. or am I missing
something?
> 3) All objrmap functions just hold read lock now. So when we
> walk a vm_set list we have to hold the corresponding
> vm_set_lock.
> 4) Since truncate uses write lock (provides exclusion) we don't
> have to take vm_set_locks.
>
> Martin! When you get time to test your SDET with this patch, please
> let me know whether this patch helps you at all. The patch applies
> on top of 2.6.5-mjb1+anobjrmap9_prio_tree.
I considered converting it to a rwsem too, details are in the the email
I posted while providing the rwspinlock solution to the parisc cache
flushing code.
As I wrote there, I wasn't convinced in the common case this is going to
gain anything significant (the only thing that sleeps while teh
semaphore is held is truncate and truncate during paging on the same
inode isn't an extremly common case, especially for the big apps), and
it makes it a bit more complicated, but giving it a try will be
interesting. I was mostly interested about having the objrmap code very
rarely failing the trylock during paging (that semaphore is by far the
biggest scalability hit during paging of shm, but the cacheline bouncing
won't be avoided by the rwsem). To make the paging scale better
(something SDET cannot measure) I don't need a safe vm_set_lock, I
believe simply making it a rwsem is the way to go just to make the
paging potentially scale a bit better. I rated implementing the locking
abstraction to fixup the basic parisc race as a bit higher prio, after
that it should be easy to have it implementing a rwsem for all archs w/o
cache flushing, the abstraction will have to expose a read/write
functionality for the rwlock. I'm not convinced your double locking is
going to boost anything even if it would be safe, I'd just take it in
write mode when the tree is being modified, with the only object of
avoiding the paging to block (and potentially to avoid blocking against
big truncates too).
next prev parent reply other threads:[~2004-04-15 0:05 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-04 12:33 Hugh Dickins
2004-04-09 20:39 ` Martin J. Bligh
2004-04-09 21:31 ` Rajesh Venkatasubramanian
2004-04-09 21:40 ` Martin J. Bligh
2004-04-09 23:17 ` Rajesh Venkatasubramanian
2004-04-09 21:51 ` Hugh Dickins
2004-04-09 22:01 ` Martin J. Bligh
2004-04-09 22:56 ` Martin J. Bligh
2004-04-11 16:09 ` Hugh Dickins
2004-04-11 17:28 ` Martin J. Bligh
2004-04-12 4:32 ` Rajesh Venkatasubramanian
2004-04-12 5:24 ` Martin J. Bligh
2004-04-12 15:46 ` Martin J. Bligh
2004-04-12 18:43 ` Hugh Dickins
2004-04-12 18:58 ` Rajesh Venkatasubramanian
2004-04-12 19:01 ` Martin J. Bligh
2004-04-12 19:10 ` Hugh Dickins
2004-04-12 19:38 ` Rajesh Venkatasubramanian
2004-04-12 21:14 ` Martin J. Bligh
2004-04-12 21:12 ` Andrew Morton
2004-04-12 21:43 ` Martin J. Bligh
2004-04-14 20:18 ` Rajesh Venkatasubramanian
2004-04-15 0:05 ` Andrea Arcangeli [this message]
2004-04-15 0:22 ` Martin J. Bligh
2004-04-15 3:40 ` Rajesh Venkatasubramanian
2004-04-15 6:23 ` Martin J. Bligh
2004-04-15 10:26 ` Hugh Dickins
2004-04-15 12:52 ` Andrea Arcangeli
2004-04-15 15:40 ` Martin J. Bligh
2004-04-15 16:55 ` Hugh Dickins
2004-04-15 17:14 ` Martin J. Bligh
2004-04-15 17:50 ` Hugh Dickins
2004-04-15 18:42 ` Dave McCracken
[not found] ` <192710000.1082052992@flay>
2004-04-15 18:47 ` Rajesh Venkatasubramanian
2004-04-15 22:40 ` Andrea Arcangeli
2004-04-15 22:33 ` Andrea Arcangeli
2004-04-15 13:00 ` Andrea Arcangeli
2004-04-15 14:41 ` Rajesh Venkatasubramanian
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=20040415000529.GX2150@dualathlon.random \
--to=andrea@suse.de \
--cc=akpm@osdl.org \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbligh@aracnet.com \
--cc=vrajesh@umich.edu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®