Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel size across compiler version #26

Open
acherm opened this issue Oct 14, 2020 · 0 comments
Open

Kernel size across compiler version #26

acherm opened this issue Oct 14, 2020 · 0 comments
Assignees

Comments

@acherm
Copy link
Collaborator

acherm commented Oct 14, 2020

An interesting direction is to investigate the effect of compiler (version) on kernel sizes.
For instance, gcc version 6.3 (the "normal" gcc version we used) VS gcc version 9.
The principle is to compile the same .config with different versions of gcc.

We can start with --tiny kernel and then generalize to any .config (e.g., such as configs already in the database).

Let's consider --tiny first and the kernel version 4.13.3
The size of a tiny kernel with gcc 6.3 is 7317008 (bytes) ~7Mb (there are many examples in the database).
The size of a tiny kernel with gcc 9.3 is 3204176 (bytes) ~3Mb (there is one example in the database, cid=193188).
Is it normal?

Well, according to our ad-hoc experiments (without tuxml and just compiling from scratch in a local machine [1]), it is.
As reported by @arnobl this reduction seems caused by:

  • former options now activated by default
  • new compilation optimisations

See https://gcc.gnu.org/gcc-9/changes.html for explanations about the
differences we observed:

Overall compile time of Firefox 66 and LibreOffice 6.2.3 on an 8-core
machine was reduced by about 5% compared to GCC 8.3, and the size of LTO
object files by 7%. LTO link-time improves by 11% on an 8-core machine
and scales significantly better for more parallel build environments.
The serial stage of the link-time optimization is 28% faster consuming
20% less memory. The parallel stage now scales to up to 128 partitions
rather than 32 and reduces memory use for every worker by 30%.

We need to further investigate this trend on other .config (not only --tiny), other versions of gcc, and other versions of the kernel

For instance, starting from which gcc version there is a decrease for --tiny? Is it really >= 9?

[1] example of ad-hoc experiment:

wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.13.3.tar.xz
tar xf linux-4.13.3.tar.xz
cd linux-4.13.3
echo "CONFIG_64BIT=y" > x86.config; KCONFIG_ALLCONFIG=x86.config
make tinyconfig
make
ls -alrth vmlinux
7,0M
gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609

@FabienZa FabienZa self-assigned this Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants