linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michel Lespinasse <walken@google.com>
To: linux-mm@kvack.org, riel@redhat.com, peterz@infradead.org,
	aarcange@redhat.com, hughd@google.com, daniel.santos@pobox.com
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Subject: [PATCH 0/7] use interval trees for anon rmap
Date: Tue,  4 Sep 2012 02:20:50 -0700	[thread overview]
Message-ID: <1346750457-12385-1-git-send-email-walken@google.com> (raw)

This patch series applies on top of the previous ones currently queued
into Andrew's -mm tree (the rbtree, augmented rbtree and interval tree
changes).

The goal here is to use interval trees to replace the same_anon_vma
linked list, and avoid anon rmap scalability issues when a given
process has many vmas linked onto the same anon_vma (as can easily
happen when a large vma is broken up into smaller chunks using
mprotect or munmap).

Patch 1 modifies the generic interval tree implementation and as such,
it can be seen as an amendment to the previous patch series which had
introduced it.

Patch 2 makes the anon_vma locking more strict in vma_adjust(), fixing
an issue I noticed when mprotect adjusts the boundary between two vmas
and only the second one has an anon_vma assigned.

Patch 3 makes the anon_vma locking more strict in move_ptes(). This is
a temporary solution to make things simpler while the anon rmap interval
tree is being introduced. Patch 7 later relaxes the locking again for the
most common cases.

Patch 4 implements the anon rmap interval tree and uses it to replace the
same_anon_vma linked list.

Patch 5 eliminates the error case in vma_address() - the call sites
have gotten their vma's from an interval tree so that the desired
pgoff (and address) are guaranteed to fall within the vma's interval.

Patch 6 adds a build option for the existing DEBUG_MM_RB code, and
extends it to check that vma's intervals have not been modified since
the vmas were added onto their interval trees.

Patch 7 avoids taking rmap locks in move_ptes() during exec() and for the
common cases of mremap(). The most common case where mremap() would still
take these locks would be if part of a large vma had been previously moved
and is now being moved back to its original location. I don't expect this
to be very frequent, though, so move_ptes() should be as efficient as it
was before patch 3 for all likely cases.

Michel Lespinasse (7):
  mm: interval tree updates
  mm: fix potential anon_vma locking issue in mprotect()
  mm anon rmap: remove anon_vma_moveto_tail
  mm anon rmap: replace same_anon_vma linked list with an interval tree.
  mm rmap: remove vma_address check for address inside vma
  mm: add CONFIG_DEBUG_VM_RB build option
  mm: avoid taking rmap locks in move_ptes()

 fs/exec.c                             |    2 +-
 include/linux/interval_tree_generic.h |  191 ++++++++++++++++++++++++++++
 include/linux/interval_tree_tmpl.h    |  219 ---------------------------------
 include/linux/mm.h                    |   29 ++++-
 include/linux/rmap.h                  |   15 ++-
 kernel/fork.c                         |    7 +-
 lib/Kconfig.debug                     |    9 ++
 lib/interval_tree.c                   |   15 +--
 mm/huge_memory.c                      |    9 +-
 mm/interval_tree.c                    |  109 ++++++++++++-----
 mm/ksm.c                              |    9 +-
 mm/memory-failure.c                   |    5 +-
 mm/mmap.c                             |  100 +++++++++++-----
 mm/mremap.c                           |   65 ++++++----
 mm/rmap.c                             |  117 +++++-------------
 15 files changed, 484 insertions(+), 417 deletions(-)
 create mode 100644 include/linux/interval_tree_generic.h
 delete mode 100644 include/linux/interval_tree_tmpl.h

-- 
1.7.7.3

             reply	other threads:[~2012-09-04  9:21 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-04  9:20 Michel Lespinasse [this message]
2012-09-04  9:20 ` [PATCH 1/7] mm: interval tree updates Michel Lespinasse
2012-09-07 22:13   ` Andrew Morton
2012-09-07 22:29     ` Michel Lespinasse
2012-09-07 22:55       ` Andrew Morton
2012-09-07 23:26         ` Michel Lespinasse
2012-09-08  4:45           ` Hillf Danton
2012-09-07 23:26         ` Michel Lespinasse
2012-09-04  9:20 ` [PATCH 2/7] mm: fix potential anon_vma locking issue in mprotect() Michel Lespinasse
2012-09-04 14:27   ` Andrea Arcangeli
2012-09-04 21:53     ` Michel Lespinasse
2012-09-04 22:16       ` Andrea Arcangeli
2012-09-05  0:45         ` Michel Lespinasse
2012-09-04  9:20 ` [PATCH 3/7] mm anon rmap: remove anon_vma_moveto_tail Michel Lespinasse
2012-09-04  9:20 ` [PATCH 4/7] mm anon rmap: replace same_anon_vma linked list with an interval tree Michel Lespinasse
2012-09-05  0:51   ` Michel Lespinasse
2012-09-04  9:20 ` [PATCH 5/7] mm rmap: remove vma_address check for address inside vma Michel Lespinasse
2012-09-04  9:20 ` [PATCH 6/7] mm: add CONFIG_DEBUG_VM_RB build option Michel Lespinasse
2012-09-14 22:14   ` Sasha Levin
2012-09-14 22:40     ` Sasha Levin
2012-09-14 22:46     ` Michel Lespinasse
2012-09-15  0:00       ` Michel Lespinasse
2012-09-15  7:52         ` Jiri Slaby
2012-09-16 19:07           ` Hugh Dickins
2012-09-22  7:19             ` Jiri Slaby
2012-09-15  9:26         ` Sasha Levin
2012-09-20 21:39           ` Fengguang Wu
2012-09-20 22:27             ` Hugh Dickins
2012-09-20 22:31               ` Fengguang Wu
2012-09-04  9:20 ` [PATCH 7/7] mm: avoid taking rmap locks in move_ptes() Michel Lespinasse

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=1346750457-12385-1-git-send-email-walken@google.com \
    --to=walken@google.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=daniel.santos@pobox.com \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=peterz@infradead.org \
    --cc=riel@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).