From: Michal Hocko <mhocko@suse.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Milan Broz <gmazyland@gmail.com>,
linux-mm@kvack.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Mikulas Patocka <mpatocka@redhat.com>
Subject: Re: Very slow unlockall()
Date: Wed, 10 Feb 2021 18:40:57 +0100 [thread overview]
Message-ID: <YCQaqRGjZKYe64zR@dhcp22.suse.cz> (raw)
In-Reply-To: <YCQQad+rzpPiDmjL@dhcp22.suse.cz>
On Wed 10-02-21 17:57:29, Michal Hocko wrote:
> On Wed 10-02-21 16:18:50, Vlastimil Babka wrote:
[...]
> > And the munlock (munlock_vma_pages_range()) is slow, because it uses
> > follow_page_mask() in a loop incrementing addresses by PAGE_SIZE, so that's
> > always traversing all levels of page tables from scratch. Funnily enough,
> > speeding this up was my first linux-mm series years ago. But the speedup only
> > works if pte's are present, which is not the case for unpopulated PROT_NONE
> > areas. That use case was unexpected back then. We should probably convert this
> > code to a proper page table walk. If there are large areas with unpopulated pmd
> > entries (or even higher levels) we would traverse them very quickly.
>
> Yes, this is a good idea. I suspect it will be little bit tricky without
> duplicating a large part of gup page table walker.
Thinking about it some more, unmap_page_range would be a better model
for this operation.
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2021-02-10 17:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-06 15:20 Milan Broz
2021-01-08 13:41 ` Michal Hocko
2021-01-08 14:39 ` Milan Broz
2021-01-31 17:22 ` Milan Broz
2021-02-01 13:08 ` Vlastimil Babka
2021-02-01 18:00 ` Milan Broz
2021-02-01 18:55 ` Vlastimil Babka
2021-02-01 19:19 ` Milan Broz
2021-02-10 15:18 ` Vlastimil Babka
2021-02-10 16:57 ` Michal Hocko
2021-02-10 17:40 ` Michal Hocko [this message]
2021-02-11 5:21 ` Hugh Dickins
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=YCQaqRGjZKYe64zR@dhcp22.suse.cz \
--to=mhocko@suse.com \
--cc=gmazyland@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mpatocka@redhat.com \
--cc=vbabka@suse.cz \
/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