View previous topic :: View next topic |
Author |
Message |
mattia29 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 28 Nov 2015 Posts: 6
|
Posted: Fri Dec 04, 2015 1:22 pm Post subject: Gentoo kernel compilation time low compared to other distres |
|
|
Hi everyone,
I'm trying gentoo for the first time in virtual box and initially I was scared by the "famous" long compilation time of gentoo packages. But when it was the time to compile the kernel, I launched the common
Code: | time make & make modules_install |
to have an estimate of the needed time. The result was like this:
real: about 9 minutes
Before Gentoo, I tried compiling the kernel on Arch both via AUR and in classical way, and on Ubuntu, also here both in the traditional way and creating the .deb package. On ubuntu I tried also with the vanilla kernel.
The results were about:
Arch (virtualbox): about 1 h 5 minutes
ubuntu (hard disk installation): about 42 minutes
There were no substantial difference between the compilation methods. Everytime I used the [/code]-j4[code] command to use all the cores and I set the kernel simply removing support to amd cpus and unused filesystems (I'm able to do only this at the moment).
The machine is a Macbook Pro 2011 with i5-2415m dual core + hyper threading, 4gb ram.
My question is: why so much difference?
Thank you |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Logicien Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/42705619553e95f9decf93.jpg)
Joined: 16 Sep 2005 Posts: 1555 Location: Montréal
|
Posted: Fri Dec 04, 2015 2:39 pm Post subject: |
|
|
Hello,
did you allow VirtualBox to use all your cpu cores with 100% of their resources in you machine configuration? What was the amount of memory you have allowed it to use compare to the host total? The compiling time would have been probably lower if done from the host.
One possible explanation is that your Gentoo kernel configuration is minimal compare to the ones of the Arch and Ubuntu. Usually, generic kernels have a very complete configuration specially to support the variety of devices they can boot on. So, they take a long time to compile compare a personnalised kernel with only needed support for one machine. _________________ Paul |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
mattia29 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 28 Nov 2015 Posts: 6
|
Posted: Fri Dec 04, 2015 2:49 pm Post subject: |
|
|
Yes, I allow virtual box to always use all cores and for both gentoo and arch the available ram is 1 gb. Ubuntu was installed on hd so it had all 4gb available.
I followed the handbook to install the gentoo kernel (manually, not with genkernel). Do you think there could be so much difference? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
NeddySeagoon Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/3946266373f47d606a2db3.jpg)
Joined: 05 Jul 2003 Posts: 54824 Location: 56N 3W
|
Posted: Fri Dec 04, 2015 7:03 pm Post subject: |
|
|
mattia29,
Thu first make will take a long time. Second and subsequent builds are fast as make is lazy.
Each time it finds an output file it is being asked to make, it compares the timestamps of all the input files required to that of the output file.
If the output file is newer, make does nothing for that file.
Run Code: | make clean
time make & make modules_install | and report your findings.
make clean removes any existing output files, which forces them to be built.
Incidentally. make will only use 1 core.
Code: | make clean
time make -j7 & make modules_install | will run 6 gcc jobs and make itself.
The kernel build can be massively parallel. Do not use make -j with no limit. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
desultory Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/15563850365c4d454383627.gif)
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Sat Dec 05, 2015 5:15 am Post subject: |
|
|
Moved from Documentation, Tips & Tricks to Kernel & Hardware, though perhaps portage & Programming would fit as well. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hu Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
Joined: 06 Mar 2007 Posts: 23085
|
Posted: Sat Dec 05, 2015 3:33 pm Post subject: |
|
|
Very long kernel compile times can be caused by building unneeded features. Distribution kernels are often configured to support every likely user, which can mean shipping support for all the popular network cards, all the popular USB devices, all the popular video cards, etc. This in turn means building a huge volume of code that, in aggregate across all users, is well used, but any particular user may run only a small part of it. A custom configured kernel, whether or not from Gentoo, can include only the things that its operator wants, which can mean building a much smaller volume of code. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
desultory Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/15563850365c4d454383627.gif)
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Tue Dec 08, 2015 4:52 am Post subject: |
|
|
Hu wrote: | Very long kernel compile times can be caused by building unneeded features. Distribution kernels are often configured to support every likely user, which can mean shipping support for all the popular network cards, all the popular USB devices, all the popular video cards, etc. This in turn means building a huge volume of code that, in aggregate across all users, is well used, but any particular user may run only a small part of it. A custom configured kernel, whether or not from Gentoo, can include only the things that its operator wants, which can mean building a much smaller volume of code. | I was thinking along the same lines, but when I re-read the post prior to moving it I thought that should have been controlled for already:
mattia29 wrote: | Everytime I used the [/code]-j4[code] command to use all the cores and I set the kernel simply removing support to amd cpus and unused filesystems (I'm able to do only this at the moment). |
Though that would depend on what was being removed from, the default configuration or make allmodconfig, or something else. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hu Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
Joined: 06 Mar 2007 Posts: 23085
|
Posted: Wed Dec 09, 2015 2:15 am Post subject: |
|
|
I considered that, but decided to interpret OP's statement as being that he removed support for AMD CPUs and unused filesystems as an exhaustive list of what he removed. If so, then he said nothing about, and possibly never modified, any of the other top level trees, like device drivers, networking support, etc. As you say, it depends on what his baseline was for each side. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
mattia29 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 28 Nov 2015 Posts: 6
|
Posted: Wed Dec 09, 2015 10:56 am Post subject: |
|
|
Sorry for the late reply, I've no time due to work. However I recompiled the kernel under Arch in VM (using before and then Code: | time make -j4 && make modules_install | ), and it took about an hour again. I paid attention to the output and saw a lot of "/drivers/wireless/..." et similia and modules which I didn't see with gentoo. So I think your answer is correct: there are a lot of enabled features which are disabled under gentoo.
Again the only things I've disabled were amd support and uncommon filesystems. I used the kernel 4.3 from kernel.org
Thank you |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|