From: Michal Hocko <mhocko@suse.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>,
Matthew Wilcox <willy@infradead.org>,
linux-mm@kvack.org, Peter Zijlstra <peterz@infradead.org>
Subject: Re: Splitting the mmap_sem
Date: Thu, 9 Jan 2020 18:03:18 +0100 [thread overview]
Message-ID: <20200109170318.GU4951@dhcp22.suse.cz> (raw)
In-Reply-To: <d36e137f-15ec-69ea-13bb-639151591ebd@suse.cz>
On Thu 09-01-20 14:56:48, Vlastimil Babka wrote:
> +CC
>
> On 1/7/20 3:27 PM, Kirill A. Shutemov wrote:
> >>>> Option 2: Add a memalloc_nowait_save/restore API to go along
> >>>> with nofs and noio. That way, we can take the RCU read lock, call
> >>>> memalloc_nowait_save(), and walk the VMA tree and the page tables in
> >>>> the current order. There's an increased chance of memory allocation of
> >>>> page tables failing, so we'll have to risk that and do a retry with the
> >>>> reference count held on the VMA if we need to sleep to allocate memory.
> >>>>
> >>>> Option 3: Variant of 2 where we add GFP flags to the p??_alloc()
> >>>> functions.
> >>>
> >>> I think this is the most reasonable way. If we are low of memory, latency
> >>> is not on the top of priorities.
> >>
> >> You prefer adding GFP flags over adding a memalloc_nowait_save()?
> >
> > I don't have strong preference here.
>
> I think it's generally a good idea to have the memalloc_() scoping.
I also think there are going to be other usecases where NOWAIT scoping
would be interesting. I am not sure this is the case for the page tables
allocation though. I might misremember but RCU based VMA handling has
been considered in the past. I do not remember details but there were
some problems and page tables allocation is not the biggest one.
> However, we use the PF_* flags where it now seems 30 out of 32 are used,
> and MEMALLOC* already occupies 3 of those.
This shouldn't be a big deal. Adding a single int to the struct page
shouldn't be terribly hard.
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2020-01-09 17:03 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-03 22:21 Matthew Wilcox
2019-12-05 17:21 ` Jerome Glisse
2019-12-06 5:13 ` Matthew Wilcox
2019-12-06 17:30 ` Jerome Glisse
2019-12-09 3:33 ` Matthew Wilcox
2019-12-09 14:17 ` Jerome Glisse
2019-12-10 15:26 ` Vlastimil Babka
2019-12-10 16:07 ` Jerome Glisse
2019-12-10 18:09 ` Vlastimil Babka
2019-12-12 14:24 ` Kirill A. Shutemov
2019-12-12 15:40 ` Matthew Wilcox
2019-12-12 15:46 ` Kirill A. Shutemov
2019-12-13 14:33 ` Matthew Wilcox
2019-12-13 18:06 ` Kirill A. Shutemov
2019-12-13 18:21 ` Matthew Wilcox
2020-01-06 22:09 ` Matthew Wilcox
2020-01-07 12:34 ` Kirill A. Shutemov
2020-01-07 13:54 ` Matthew Wilcox
2020-01-07 14:27 ` Kirill A. Shutemov
2020-01-09 13:56 ` Vlastimil Babka
2020-01-09 17:03 ` Michal Hocko [this message]
2020-01-09 17:07 ` Michal Hocko
2020-01-09 17:32 ` SeongJae Park
2020-01-09 20:13 ` Matthew Wilcox
2020-02-06 13:59 ` Peter Zijlstra
2020-02-06 20:15 ` Matthew Wilcox
2020-02-06 20:55 ` Peter Zijlstra
2020-02-06 21:20 ` Matthew Wilcox
2020-02-07 8:52 ` Peter Zijlstra
2020-02-10 22:00 ` Matthew Wilcox
2020-02-19 17:14 ` Laurent Dufour
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=20200109170318.GU4951@dhcp22.suse.cz \
--to=mhocko@suse.com \
--cc=kirill@shutemov.name \
--cc=linux-mm@kvack.org \
--cc=peterz@infradead.org \
--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