[PATCH] D141659: [BOLT][HUGIFY] Adds fix for -hugify option

Alexey Moksyakov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 23:30:31 PST 2023


yavtuk created this revision.
yavtuk added reviewers: maksfb, rafauler, treapster.
Herald added a subscriber: ayermolo.
Herald added a reviewer: Amir.
Herald added a project: All.
yavtuk requested review of this revision.
Herald added subscribers: llvm-commits, yota9.
Herald added a project: LLVM.

This patch is used as the temporary solution due to dependence on kernel configuration and anonymous pages usage.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141659

Files:
  bolt/runtime/hugify.cpp


Index: bolt/runtime/hugify.cpp
===================================================================
--- bolt/runtime/hugify.cpp
+++ bolt/runtime/hugify.cpp
@@ -150,6 +150,16 @@
   DEBUG(reportNumber("[hugify] aligned huge page from: ", (uint64_t)From, 16);)
   DEBUG(reportNumber("[hugify] aligned huge page to: ", (uint64_t)To, 16);)
 
+  // Using hugifyForOldKernel for all kernels is the temporary solution
+  // due to kernel configuration issue and the mandatory requirement to use
+  // anonymous pages
+  //
+  // https://github.com/facebookincubator/BOLT/issues/313
+  // https://reviews.llvm.org/D140425
+  // https://reviews.llvm.org/D137620
+  hugifyForOldKernel(From, To);
+
+#if 0
   if (!hasPagecacheTHPSupport()) {
     DEBUG(report(
               "[hugify] workaround with memory alignment for kernel < 5.10\n");)
@@ -162,6 +172,7 @@
     // TODO: allow user to control the failure behavior.
     reportError(Msg, sizeof(Msg));
   }
+#endif
 }
 
 /// This is hooking ELF's entry, it needs to save all machine state.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141659.488872.patch
Type: text/x-patch
Size: 1032 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230113/f06006da/attachment.bin>


More information about the llvm-commits mailing list