The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Hugh Dickins <hugh@veritas.com>
Cc: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: anon-vma (and now filebacked-mappings too) mprotect vma merging [Re:    2.6.5-rc2-aa vma merging]
Date: Sun, 4 Apr 2004 03:01:47 +0200	[thread overview]
Message-ID: <20040404010147.GS2307@dualathlon.random> (raw)
In-Reply-To: <Pine.LNX.4.44.0404031954250.10509-100000@localhost.localdomain>

On Sat, Apr 03, 2004 at 08:29:15PM +0100, Hugh Dickins wrote:
> I liked Andrew's vma->page_table_lock suggestion, was imagining we

vma->page_table_lock cannot help you with anonmm, the rbtree is global,
for that you still need a mm-wide lock with anonmm. I serialize
read/write the rbtree only with the mmap_sem, you cannot.

vma->page_table_lock helps _only_ in the pagetable scanning: so only
_after_ nuking the global page_table_lock like I can do thanks to
anon_vma. you cannot drop the mm-wide page_table_lock with anonmm.
vma->page_table_lock is a natural optimization for the anon-vma logic
instead (after fixing the mremap/truncate race ;).

To drop the page_table_lock during vma manipulations in anonmm (and so
to give a real sense to a vma->page_table_lock in anonmm) you could use
a down_read_trylock on the mm->mmap_sem, but that is not going to work
well: the mmap_sem can be taken during extended period of times
involving I/O, and you may never get it. BTW, now that the lookup on the
prio-tree is immediate the i_shared_sem has no reason anymore to be a
semaphore either, it should go back to a spinlock like in 2.4, like the
anon_vma is also protected by a spinlock.

  reply	other threads:[~2004-04-04  1:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.44.0403291957240.19124-100000@localhost.localdomain>
2004-03-29 19:45 ` 2.6.5-rc2-aa vma merging Hugh Dickins
2004-04-02 11:34   ` Hugh Dickins
2004-04-02 15:35     ` Andrea Arcangeli
2004-04-03  1:26       ` anon-vma (and now filebacked-mappings too) mprotect vma merging [Re: 2.6.5-rc2-aa vma merging] Andrea Arcangeli
2004-04-03 17:06         ` Hugh Dickins
2004-04-03 17:24           ` Andrea Arcangeli
2004-04-03 18:46             ` Andrea Arcangeli
2004-04-03 19:29               ` Hugh Dickins
2004-04-04  1:01                 ` Andrea Arcangeli [this message]
2004-04-04  1:13                   ` Andrew Morton
2004-04-04  1:32                     ` Andrea Arcangeli
2004-04-04  1:43                       ` Andrew Morton
2004-04-04  1:55                         ` Andrea Arcangeli

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=20040404010147.GS2307@dualathlon.random \
    --to=andrea@suse.de \
    --cc=akpm@osdl.org \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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