[llvm] [Draft][BOLT] fix hugify for old kernels (#201813) (PR #201818)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 05:29:53 PDT 2026


DmitriiMartynov wrote:

> If it is not feasible to detect actual kernel mapping behavior at runtime I think we should have that under option instead of relying on unconditional extra padding. Adding @aaupov for visibility since mTHP support touches the same area.

If we detect the process mapping at runtime, there is a possibility that hugify will be applied only to a part of the code. And this way is slightly hacky.
Therefore, it should be handled during BOLT optimization.
However, I don't think we need to add a new hugify sub-option for extra pages just for old kernels.
On the other hand, in the current implementation, the extra hugepages increase the file size for both old and new kernels (which is unnecessary).
I think it is possible to solve the issue with additional file size during file offset and virtual address calculation.

https://github.com/llvm/llvm-project/pull/201818


More information about the llvm-commits mailing list