linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* mm/khugepaged: collapse file/shmem compound pages
@ 2022-05-24 22:42 Zach O'Keefe
  2022-05-25 19:07 ` Matthew Wilcox
  0 siblings, 1 reply; 12+ messages in thread
From: Zach O'Keefe @ 2022-05-24 22:42 UTC (permalink / raw)
  To: willy; +Cc: David Rientjes, linux-mm

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/


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-06-01 11:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-24 22:42 mm/khugepaged: collapse file/shmem compound pages Zach O'Keefe
2022-05-25 19:07 ` 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

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).