linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michel Lespinasse <walken@google.com>
To: lsf-pc@lists.linux-foundation.org
Cc: linux-mm <linux-mm@kvack.org>,
	Davidlohr Bueso <dave@stgolabs.net>,
	 Jerome Glisse <jglisse@redhat.com>,
	Laurent Dufour <ldufour@linux.ibm.com>,
	 "Liam R. Howlett" <Liam.Howlett@oracle.com>,
	Matthew Wilcox <willy@infradead.org>,
	 Vlastimil Babka <vbabka@suse.cz>,
	David Rientjes <rientjes@google.com>,
	Hugh Dickins <hughd@google.com>,
	 Peter Zijlstra <peterz@infradead.org>
Subject: [LSF/MM/BPF TOPIC] Replacing mmap_sem with finer grained locks
Date: Fri, 14 Feb 2020 05:03:38 -0800	[thread overview]
Message-ID: <CANN689EippvdwsHuhU-Aq=kNdk8-cAaCzPC7v=zbe6X302NteA@mail.gmail.com> (raw)

Hi,

I would like to propose this topic for LSF/MM 2020. This is a
continuation of discussions that were started at LSF/MM 2019 and have
informally continued since between the copied folks and I.

The fact that mmap_sem locks the entire MM is causing a lot of
problems. The fundamental design hasn't changed in 20+ years, though a
number of hacks have been added (such as releasing the mmap_sem during
page faults) to work around the worst issues with it. In modern
threaded workloads, we often see multiple threads running
non-overlapping memory operations, which end up unnecessarily blocking
on each other because mmap_sem only supports locking the entire MM
rather than just the address range each thread is operating on.

I have been working on a patch set to replace the mmap_sem rwsem with
a range lock, which should resolve this issue. This is currently
implemented through the page fault path and some very narrow cases of
mmap(); I am working to broaden the scope of the mmap changes before
sending this patch set publicly; I also know Davidlohr and Vlastimil
have been working on similar approaches in the past.

Another approach that is being explored is speculative page faults; I
know Peter and Laurent have been working on this in the past and
Matthew is giving this another look at the moment. I think this is a
different angle to approach the problem from; I think this solution is
not as generic (my understanding is that it only works for the page
fault path), but more efficient for the cases that it handles.

I really would like to get a new discussion about this, to discuss the
concrete proposals that people have been working on and set a
direction moving forward.

-- 
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.


             reply	other threads:[~2020-02-14 13:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14 13:03 Michel Lespinasse [this message]
2020-02-27 17:30 ` Vlastimil Babka

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='CANN689EippvdwsHuhU-Aq=kNdk8-cAaCzPC7v=zbe6X302NteA@mail.gmail.com' \
    --to=walken@google.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=dave@stgolabs.net \
    --cc=hughd@google.com \
    --cc=jglisse@redhat.com \
    --cc=ldufour@linux.ibm.com \
    --cc=linux-mm@kvack.org \
    --cc=lsf-pc@lists.linux-foundation.org \
    --cc=peterz@infradead.org \
    --cc=rientjes@google.com \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.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