[PATCH] D137620: [BOLT] Don't align .text to pageAlign

Maksim Panchenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 20 13:46:27 PST 2022


maksfb added a comment.

In D137620#3977958 <https://reviews.llvm.org/D137620#3977958>, @treapster wrote:

>> I don't have any performance data for regular-size pages. It will be good to collect some, e.g. for clang. If there's indeed no difference, we can do page-size alignment only for huge pages.
>
> I'm not sure how to properly collect such data without polluting it with noise from OS and build system. Simply timing builds will produce a very diverse set of values without obvious correlation with the binary used.

If you don't have a benchmark system setup, it's fine. I'll see if I can run something quickly.

>> Is it b/c we assume there's nothing but a PHDR table before the code in the new segment?
>
> Well, if we create new segment it's guaranteed there's nothing but a PHDR table before the code because we call mapCodeSections before anything else.

At the moment - yes. So this is the assumption there.

>> Should we always align and disregarding the padding then (i.e. keep things as they are)? Sorry, if I missed your point.
>
> My point is to align only when it makes sense, and aligning after PHDR does not.

How do you define what makes sense?

> With use-old-text it's not so clear, so we can align in that case if you feel like it, but at least we shouldn't align after PHDR.

Why? Because PHDR is "small"?

> And also it doesn't make sense to align to 2 MB in absence of hugify(because we won't get huge pages anyway), so i think we should act as if -no-huge-pages is true by default. What do you think?

I agree that it doesn't make sense to align at 2MB in the absence of hugify *and* --hot-text.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137620/new/

https://reviews.llvm.org/D137620



More information about the llvm-commits mailing list