Re: [PATCH 3/4] mm: add shared read-only vmemmap support for FS-DAX

From: Muchun Song

Date: Thu Oct 29 2026 - 01:35:58 EST




> On Oct 29, 2026, at 11:05, Yilei Zheng <trilith.zheng@xxxxxxxxx> wrote:
>
> Hi Muchun,
>
>> Thank you very much for the test, so in your scenario, this is also
>> the behavior of your real workload (mainly read/write-based, rather
>> than mmap), right?
>
> Yes. We mount read-only rootfs images over virtio-pmem and FS-DAX. Most
> file access goes through normal read/write. mmap is only used for
> loading binaries and shared libraries at startup, which is a small part
> of the image.

What's the size of the roots image? And I just want to know how much memory
this series could save in your workload.

>
>> To be fair, it does fix the issue, but it's not very clean. I might
>> do some code cleanup first to solve this more gracefully. I want to
>> move the initialization to where the template page is allocated,
>> similar to what section-based vmemmap optimization does.
>
> Makes sense. Initializing it at allocation time is cleaner.
>
>> Thanks for the analysis and suggestions. However, the reason I
>> haven't sent out v2 yet is that I've been trying to refactor the
>> vmemmap optimization logic to make FS_DAX support cleaner. I think
>> I'll probably do some code refactoring first.
>
> Understood. It would also help if the refactor could support subsection
> (2 MiB) alignment, so any 2 MiB-aligned device can use the optimization
> without padding to a 128 MiB multiple.

I think I can.

>
>> I'cc you next time if you'd like to help me test.
>
> Sounds good. Please Cc me when you post v2 and I'll be glad to test.

Thanks.

>
> Best regards,
> Yilei