linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hyeonggon Yoo <42.hyeyoo@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org, liam.howlett@oracle.com, surenb@google.com,
	ldufour@linux.ibm.com, michel@lespinasse.org, vbabka@suse.cz,
	linux-kernel@vger.kernel.org
Subject: Re: [QUESTION] about the maple tree and current status of mmap_lock scalability
Date: Mon, 20 Feb 2023 14:26:49 +0000	[thread overview]
Message-ID: <Y/ODKQFj446+KBSy@localhost> (raw)
In-Reply-To: <Y7LsDgMxHh8NHzDY@casper.infradead.org>

On Mon, Jan 02, 2023 at 02:37:02PM +0000, Matthew Wilcox wrote:
> On Mon, Jan 02, 2023 at 09:04:12PM +0900, Hyeonggon Yoo wrote:
> > > https://www.infradead.org/~willy/linux/store-free-page-faults.html
> > > outlines how I intend to proceed from Suren's current scheme (where
> > > RCU is only used to protect the tree walk) to using RCU for the
> > > entire page fault.
> > 
> > Thank you for sharing this your outlines.
> > Okay, so the planned scheme is:
> > 
> > 	1. Try to process entire page fault under RCU protection
> > 		- if failed, goto 2. if succeeded, goto 4.
> > 
> > 	2. Fall back to Suren's scheme (try to take VMA rwsem)
> > 		- if failed, goto 3. if succeeded, goto 4.
> 
> Right.  The question is whether to restart the page fault under Suren's
> scheme, or just grab the VMA rwsem and continue.  Experimentation
> needed.
> 
> It's also worth noting that Michel has an alternative proposal, which
> is to drop out of RCU protection before trying to allocate memory, then
> re-enter RCU mode and check the sequence count hasn't changed on the
> entire MM.  His proposal has the advantage of not trying to allocate
> memory while holding the RCU read lock, but the disadvantage of having
> to retry the page fault if anyone has called mmap() or munmap().  Which
> alternative is better is going to depend on the workload; do we see more
> calls to mmap()/munmap(), or do we need to enter page reclaim more often?
> I think they're largely equivalent performance-wise in the fast path.
> Another metric to consider is code complexity; he thinks his method
> is easier to understand and I think mine is easier.  To be expected,
> I suppose ;-)

I'm planning to suggest a cooperative project to my colleagues
that would involve making __p?d_alloc() take gfp flags.

Wondering if there was any progress or conclusion made on which
approach is better for full RCU page faults, or was there another
solution proposed?

Asking this because I don't want to waste my time if the approach
has been abandoned.

Regards,
Hyeonggon

> > 	3. Fall back to mmap_lock
> > 		- goto 4.
> > 
> > 	4. Finish page fault.


  reply	other threads:[~2023-02-20 14:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-28 12:48 [QUESTION] about the maple tree and current status of mmap_lock scalability Hyeonggon Yoo
2022-12-28 17:10 ` Suren Baghdasaryan
2022-12-29 11:33   ` Hyeonggon Yoo
2022-12-28 20:50 ` Matthew Wilcox
2022-12-29 14:22   ` Hyeonggon Yoo
2022-12-29 16:51     ` Matthew Wilcox
2022-12-29 17:10       ` Lorenzo Stoakes
2022-12-29 17:21         ` Suren Baghdasaryan
2022-12-29 17:31         ` Matthew Wilcox
2023-01-02 12:04       ` Hyeonggon Yoo
2023-01-02 14:37         ` Matthew Wilcox
2023-02-20 14:26           ` Hyeonggon Yoo [this message]
2023-02-20 14:43             ` Matthew Wilcox
2023-02-22 11:38               ` Hyeonggon Yoo

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=Y/ODKQFj446+KBSy@localhost \
    --to=42.hyeyoo@gmail.com \
    --cc=ldufour@linux.ibm.com \
    --cc=liam.howlett@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=michel@lespinasse.org \
    --cc=surenb@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;
as well as URLs for NNTP newsgroup(s).