3 ms·
Exciting if true! I see https://docs.kernel.org/filesystems/proc.html https://docs.kernel.org/filesystems/proc.html describes FilePmdMapped as "Page cache mapp
by scottlamb 4y ago
Exciting if true!
I see https://docs.kernel.org/filesystems/proc.html https://docs.kernel.org/filesystems/proc.html describes FilePmdMapped as "Page cache mapped into userspace with huge pages", consistent with what you are saying. I don't fully understand the distinction between that and FileHugePages: "Memory used for filesystem data (page cache) allocated with huge pages". I wouldn't think it'd be possible to map it into userspace as huge pages if the kernel hasn't allocated it as contiguous physical memory (and consistently aligned with the userspace virtual addresses), so there's something I'm missing.
What kernel version did that output come from? Do you happen to know if Firefox did anything special to set that up? What filesystem type is this?
- scottlamb 4y agoHuh. I did a little digging through kernel source. There's been a CONFIG_READ_ONLY_THP_FOR_FS since 2019. It's still marked as experimental and isn't enabled on the precompiled kernel I'm using (with Ubuntu 22.10). Is that option set on your kernel, or is this something else? I also see something about MADV_COLLAPSE that supposedly supports file-backed pages. [1] [1] https://lwn.net/Articles/913363/ https://lwn.net/Articles/913363/
- the8472 4y agoYeah, it's enabled here $ zgrep 'CONFIG_READ_ONLY_THP_FOR_FS' /proc/config.gz CONFIG_READ_ONLY_THP_FOR_FS=y > What kernel version did that output come from? kernel 6.2.8-arch1-1 > What filesystem type is this? btrfs > I don't fully understand the distinction between that and FileHugePages: "Memory used for filesystem data (page cache) allocated with huge pages". Probably pages in the page cache that aren't mapped into a user process. Which is what happens when you read()