[llvm] [BOLT][hugify] Support "--hugify-all-text" to enable THP for all code segments (PR #220258)
Jinjie Huang via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 23 06:26:42 PDT 2026
Jinjie-Huang wrote:
> Hello LLVM community, I want to drop a quick note regarding some recent kernel changes that are related to the `hugify` benefits being discussed here, based on my past experience testing [large .text mapping](https://lore.kernel.org/linux-mm/e62f4caf-57dc-445e-be29-aff324e0d444@arm.com/).
> I noticed another recent RFC thread discussing a new `-fenable-readonly-thp` or `iTHP` feature that explicitly requires the two kernel settings mentioned above. This may not be the right place, but I want to shed some light on the new system behavior which may be helpful.
Thanks for sharing! The results of natively enabling huge pages in the kernel look really promising. I agree that having the kernel seamlessly and automatically handle this across various architectures is the ideal solution. I think both the “-fenable-readonly-thp [RFC](https://discourse.llvm.org/t/rfc-enable-read-only-transparent-huge-pages-thp-for-executable-text-segment/91646)" (manual madvise for file-backed memory) and the "--hugify-all-text" approach (further using anonymous memory to bypass kernel limits, though this doesn't strictly need to reside within BOLT) are inherently somewhat hacky. Essentially, these are engineering trade-offs made for existing production environments for now.
https://github.com/llvm/llvm-project/pull/220258
More information about the llvm-commits
mailing list