Repository navigation
Conversation
kvinwang
force-pushed
the
feat/guest-thp
branch
from
October 30, 2026 00:34
ff5a0ff to
2fc4caa
Compare
kvinwang
force-pushed
the
feat/guest-kernel-perf
branch
from
October 30, 2026 00:35
782e517 to
6405796
Compare
- READ_ONLY_THP_FOR_FS: khugepaged can collapse read-only file mappings (program and library text) into huge pages, for regions marked MADV_HUGEPAGE or everything under THP "always". Without it, large-code workloads run their text from 4 KiB pages, and every iTLB miss pays the two-dimensional (guest + EPT) page walk. - LRU_GEN: Multi-Gen LRU, built in but off by default (LRU_GEN_ENABLED unset); a workload under memory pressure turns it on through /sys/kernel/mm/lru_gen/enabled. - TCP_CONG_BBR: built in rather than a module, so a container can select it in its own network namespace without the privilege to load a module. The default stays cubic. - DEFERRED_STRUCT_PAGE_INIT: struct pages for most of memory are initialised by parallel kthreads after SMP bring-up instead of on the boot CPU, which shortens boot of large guests. None of them changes behaviour unless a workload opts in, except the deferred initialisation, which only moves work at boot. Added to both backends and asserted in parity.json. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
force-pushed
the
feat/guest-kernel-perf
branch
from
October 30, 2026 02:23
6405796 to
bcd2035
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
READ_ONLY_THP_FOR_FS=yMADV_HUGEPAGE/MADV_COLLAPSE, or THPalwaysLRU_GEN=yLRU_GEN_ENABLEDunset)echo y > /sys/kernel/mm/lru_gen/enabledTCP_CONG_BBR=ynet.ipv4.tcp_congestion_control=bbrDEFERRED_STRUCT_PAGE_INIT=yAll four are added to both backends and asserted in
parity.json.Testing:
make os-imagepasses, and the built.confighas all four options.MADV_COLLAPSEon a read-only executable mapping of a 64 MiB ext4 file:EINVAL→ 0,FilePmdMapped: 65536 kB.lru_gen/enabledabsent →0x0000, and switches to0x0007.bbris available and selectable.node 0 deferred pages initialised in 23ms.Run /initat 7.23–7.24 s vs 7.44–8.15 s fornextwithout this PR.MADV_COLLAPSEwith data checks before and after collapse, and after a write through a newO_WRONLYopen, on ZFS (64 MiB–1 GiB), ext4, the squashfs rootfs and an overlay2-on-ZFS file in an unprivileged container: all consistent. On ZFS (no large folios) the first writable open drops the collapsed folios; ext4 keeps them.MADV_HUGEPAGE) on ZFS collapses as well.MADV_COLLAPSEloops racing a writer on one ZFS file (~26k collapses): no mapping/preadmismatch, no kernel warnings,zpool scrubclean.bbrin its netns; the host stays on cubic.lru_gentoggles0x0000↔0x0007.