From: "Zach O'Keefe" <zokeefe@google.com>
To: willy@infradead.org
Cc: David Rientjes <rientjes@google.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: mm/khugepaged: collapse file/shmem compound pages
Date: Tue, 24 May 2022 15:42:55 -0700 [thread overview]
Message-ID: <CAAa6QmTLOLoygZeGgnsVHH_+wV78cN45aqbsYnXPACjNME7jCw@mail.gmail.com> (raw)
Hey Matthew,
I'm leading an attempt to add a new madvise mode, MADV_COLLAPSE, to
allow userspace-directed collapse of memory into THPs[1]. The initial
proposal only supports anonymous memory, but I'm
working on adding support for file-backed and shmem memory.
The intended behavior of MADV_COLLAPSE is that it should return
"success" if all hugepage-aligned / sized regions requested are backed
by pmd-mapped THPs on return (races aside). IOW: we were able to
successfully collapse the memory, or it was already backed by
pmd-mapped THPs.
Currently there is a nice "XXX: khugepaged should compact smaller
compound pages into a PMD sized page" in khugepaged_scan_file() when
we encounter a compound page during scanning. Do you know what kind of
gotchas or technical difficulties would be involved in doing this? I
presume this work would also benefit those relying on khugepaged to
collapse read-only file and shmem memory, and I'd be happy to help
move it forward.
Thanks for your time,
Zach
[1] https://lore.kernel.org/linux-mm/20220504214437.2850685-1-zokeefe@google.com/
next reply other threads:[~2022-05-24 22:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-24 22:42 Zach O'Keefe [this message]
2022-05-25 19:07 ` mm/khugepaged: collapse file/shmem compound pages Matthew Wilcox
2022-05-26 1:23 ` Zach O'Keefe
2022-05-26 3:36 ` Matthew Wilcox
2022-05-27 0:54 ` Zach O'Keefe
2022-05-27 3:47 ` Matthew Wilcox
2022-05-27 16:27 ` Zach O'Keefe
2022-05-28 3:48 ` Matthew Wilcox
2022-05-29 21:36 ` Zach O'Keefe
2022-05-30 1:25 ` Rongwei Wang
2022-06-01 5:19 ` Zach O'Keefe
2022-06-01 11:26 ` Rongwei Wang
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=CAAa6QmTLOLoygZeGgnsVHH_+wV78cN45aqbsYnXPACjNME7jCw@mail.gmail.com \
--to=zokeefe@google.com \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--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).