Re: [PATCH v2 00/16] Address some perf memory/data size issues

From: Andi Kleen
Date: Tue May 30 2023 - 04:00:17 EST


> BSS won't count toward file size, which the patches were primarily
> going after - but checking the size numbers I have miscalculated from
> reading size's output that I'm not familiar with. The numbers are
> still improved, but I just see a 37kb saving, with 5kb more in
> .rodata. Something but not much. .data.rel.ro is larger, which imo is
> good, but those pages will still be dirtied so a mute point wrt file
> size and memory overhead.

The way perf is written (lots of separate code depending on a single high level
switch) most pages probably won't be dirtied.

>
> For huge pages I thought it was correct that things are aligned by max
> page size which I thought on x86-64 was 2MB, so I tried:
> EXTRA_LDFLAGS="-z max-page-size=4096"
> but it made no difference to anything, and with:
> EXTRA_CFLAGS="-Wl,-z,max-page-size=4096"
> EXTRA_CXXFLAGS="-Wl,-z,max-page-size=4096"
> file size just got worse.

The default alignment to 2MB was dropped in the GNU toolchain in 2018 or
so.

-Andi