From: Nathan Chancellor <nathan@kernel.org>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Petr Pavlu <petr.pavlu@suse.com>,
tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
ndesaulniers@google.com, trix@redhat.com, corbet@lwn.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5] x86: Avoid relocation information in final vmlinux
Date: Mon, 20 Mar 2023 22:23:41 -0700 [thread overview]
Message-ID: <20230321052341.GA1536736@dev-arch.thelio-3990X> (raw)
In-Reply-To: <e8a36925-2965-1dae-da01-5d06ba6747c8@intel.com>
On Mon, Mar 20, 2023 at 01:12:07PM -0700, Dave Hansen wrote:
> On 3/20/23 05:10, Petr Pavlu wrote:
> > The issue is then that the collected vmlinux file and hence distribution
> > packages end up unnecessarily large because of this extra data. The
> > following is a size comparison of vmlinux v6.0 with and without the
> > relocation information:
> > | Configuration | With relocs | Stripped relocs |
> > | x86_64_defconfig | 70 MB | 43 MB |
> > | +CONFIG_DEBUG_INFO | 818 MB | 367 MB |
> >
> > Optimize a resulting vmlinux by adding a postlink step that splits the
> > relocation information into vmlinux.relocs and then strips it from the
> > vmlinux binary.
>
> When I saw that this adds a postlink step, I read that as, "adds another
> step to the unbearably slow single-threaded part of kernel builds". :)
>
> But, here's one data point that made me feel a lot better. Using a
> random .config:
>
> > https://sr71.net/~dave/intel/config-reloctest
>
> the builds get a _bit_ slower, going from 37.0s->37.7s. This is pretty
> arbitrary of course, using my compiler on my hardware, so YMMV. But,
> for me, this seems like a reasonable tradeoff given the space savings.
>
> I'd be curious what other people are seeing.
I am seeing a negligible difference (~1%) with LLVM 16 when targeting
the following configuration combinations and building the 'bzImage'
target.
* allmodconfig:
Benchmark 1: v6.3-rc3
Time (mean ± σ): 93.370 s ± 0.313 s [User: 3462.570 s, System: 371.420 s]
Range (min … max): 92.993 s … 93.659 s 5 runs
Benchmark 2: v6.3-rc3 + "x86: Avoid relocation information in final vmlinux"
Time (mean ± σ): 93.539 s ± 0.193 s [User: 3464.361 s, System: 370.709 s]
Range (min … max): 93.281 s … 93.816 s 5 runs
Summary
'v6.3-rc3' ran
1.00 ± 0.00 times faster than 'v6.3-rc3 + "x86: Avoid relocation information in final vmlinux"'
* allmodconfig + debug info (DWARF5):
Benchmark 1: v6.3-rc3
Time (mean ± σ): 97.952 s ± 0.451 s [User: 3673.380 s, System: 378.814 s]
Range (min … max): 97.420 s … 98.568 s 5 runs
Benchmark 2: v6.3-rc3 + "x86: Avoid relocation information in final vmlinux"
Time (mean ± σ): 98.302 s ± 1.050 s [User: 3674.310 s, System: 378.323 s]
Range (min … max): 97.603 s … 100.152 s 5 runs
Summary
'v6.3-rc3' ran
1.00 ± 0.01 times faster than 'v6.3-rc3 + "x86: Avoid relocation information in final vmlinux"'
* allyesconfig bzImage:
Benchmark 1: v6.3-rc3
Time (mean ± σ): 674.232 s ± 1.581 s [User: 24901.883 s, System: 2223.728 s]
Range (min … max): 672.478 s … 676.678 s 5 runs
Benchmark 2: v6.3-rc3 + "x86: Avoid relocation information in final vmlinux"
Time (mean ± σ): 679.783 s ± 2.454 s [User: 24903.720 s, System: 2228.943 s]
Range (min … max): 676.369 s … 682.772 s 5 runs
Summary
'v6.3-rc3' ran
1.01 ± 0.00 times faster than 'v6.3-rc3 + "x86: Avoid relocation information in final vmlinux"'
* allyesconfig + debug info (DWARF5):
Benchmark 1: v6.3-rc3
Time (mean ± σ): 709.745 s ± 1.880 s [User: 26570.531 s, System: 2304.563 s]
Range (min … max): 707.918 s … 712.818 s 5 runs
Benchmark 2: v6.3-rc3 + "x86: Avoid relocation information in final vmlinux"
Time (mean ± σ): 711.773 s ± 1.152 s [User: 26571.973 s, System: 2307.176 s]
Range (min … max): 710.127 s … 713.224 s 5 runs
Summary
'v6.3-rc3' ran
1.00 ± 0.00 times faster than 'v6.3-rc3 + "x86: Avoid relocation information in final vmlinux"'
Cheers,
Nathan
prev parent reply other threads:[~2023-03-21 5:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-20 12:10 Petr Pavlu
2023-03-20 18:35 ` Nick Desaulniers
2023-03-21 11:57 ` Borislav Petkov
2023-03-24 10:31 ` Petr Pavlu
2023-03-24 10:30 ` Petr Pavlu
2023-03-20 20:12 ` Dave Hansen
2023-03-21 5:23 ` Nathan Chancellor [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230321052341.GA1536736@dev-arch.thelio-3990X \
--to=nathan@kernel.org \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=ndesaulniers@google.com \
--cc=petr.pavlu@suse.com \
--cc=tglx@linutronix.de \
--cc=trix@redhat.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®