LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-28-2021, 02:18 PM   #1
Chuck56
Member
 
Registered: Dec 2006
Location: Colorado, USA
Distribution: Slackware
Posts: 930

Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
Kernel Build Time


It takes me just under 3 hours to build kernel packages with Pat's scripts. That's using my desktop which has the best specs. Is 3 hours good, bad or it depends?

Pat's scripts build all 5 packages (source, huge, generic, modules & headers). I only need the kernel-generic & the kernel-modules packages to build the initrd & run the custom kernels.

I started by following dive's helpful doc: Yet Another Kernel Compile Guide

I've setup a couple scripts that run from a KDE5 terminal or CLI tty (KDE5 logged out) at similar speeds:
  1. setup the build directories & download the build files then
  2. modify the config files, prepare the variables & run Pat's build-all-kernel.sh script.
I haven't built kernels for a long time so I'm a bit rusty on the best ways.
 
Old 02-28-2021, 02:50 PM   #2
Daedra
Senior Member
 
Registered: Dec 2005
Location: Springfield, MO
Distribution: Slackware64-15.0
Posts: 2,683

Rep: Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375
I have a new Ryzen 5900x system and I can compile just the kernel in 5 minutes. And when I did Pat's SlackBuild a while back I know it took less than 15 minutes for me.
 
2 members found this post helpful.
Old 02-28-2021, 02:59 PM   #3
Chuck56
Member
 
Registered: Dec 2006
Location: Colorado, USA
Distribution: Slackware
Posts: 930

Original Poster
Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
3 hours vs 15 minutes. That's a big difference! I need to find a better way.
 
Old 02-28-2021, 03:03 PM   #4
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
I compiled new test kernels a couple of weeks ago on an 4-core i5 Skylake. Time was about 20 minutes.
 
1 members found this post helpful.
Old 02-28-2021, 03:19 PM   #5
Chuck56
Member
 
Registered: Dec 2006
Location: Colorado, USA
Distribution: Slackware
Posts: 930

Original Poster
Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
I've got an i5-5250U CPU @ 1.60GHz NUC with 16GB RAM and an 500GB SSD. I'll try a build on that box and see if it can turn a lower time.

EDIT:
I'll look into distributed compiles with icecream also. Based on this thread:[HOWTO] Set up icecream. I have 4 LAN machines with available cycles that I can use.

Last edited by Chuck56; 02-28-2021 at 03:42 PM. Reason: added icrcream
 
Old 02-28-2021, 03:52 PM   #6
Tonus
Senior Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-15.0
Posts: 1,405
Blog Entries: 3

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
Quote:
Originally Posted by Chuck56 View Post
I've got an i5-5250U CPU @ 1.60GHz NUC with 16GB RAM and an 500GB SSD. I'll try a build on that box and see if it can turn a lower time.
What about benchmarking your CPU againt the Ryzen 5900x ?

Ryzen 5900x
12 Cores, 24 Threads @3.7GHz, Zen3.
Release date: Q4 2020.

i5-5250U
2 Cores, 4 Threads @1.6 GHz, Broadwell.
Release date ≈ Q1 2015.

EDIT
No very clear message : your time seems correct to me regarding the difference between the machines.

Quote:
Originally Posted by Chuck56 View Post
I've got an i5-5250U CPU @ 1.60GHz NUC with 16GB RAM and an 500GB SSD. I'll try a build on that box and see if it can turn a lower time.
EDIT:
I'll look into distributed compiles with icecream also. Based on this thread:[HOWTO] Set up icecream. I have 4 LAN machines with available cycles that I can use.
That sounds promising, thank you for the heads up.

Last edited by Tonus; 02-28-2021 at 04:06 PM.
 
Old 02-28-2021, 04:21 PM   #7
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
i7 Kaby Lake building Gentoo kernel with -j8
Code:
Kernel: arch/x86/boot/bzImage is ready  (#2)

real    2m57.751s
user    18m56.206s
sys     1m21.362s
I remember my first ever kernel build on 486DX, kernel version was 2.0 and it took 14 hours ...

Edit: for those not familiar with time output, it took just under three minutes.

Last edited by Emerson; 02-28-2021 at 04:24 PM.
 
1 members found this post helpful.
Old 02-28-2021, 04:30 PM   #8
Chuck56
Member
 
Registered: Dec 2006
Location: Colorado, USA
Distribution: Slackware
Posts: 930

Original Poster
Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
Quote:
Originally Posted by Emerson View Post
i7 Kaby Lake building Gentoo kernel with -j8
Code:
Kernel: arch/x86/boot/bzImage is ready  (#2)

real    2m57.751s
user    18m56.206s
sys     1m21.362s
I remember my first ever kernel build on 486DX, kernel version was 2.0 and it took 14 hours ...

Edit: for those not familiar with time output, it took just under three minutes.
Yikes! I feel the need, the need for speed!
 
Old 02-28-2021, 04:38 PM   #9
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Chuck56,

I cheated, this is very trimmed down custom kernel. Building a generic include-it-all would take much longer, I'm sure.
 
Old 02-28-2021, 08:44 PM   #10
Chuck56
Member
 
Registered: Dec 2006
Location: Colorado, USA
Distribution: Slackware
Posts: 930

Original Poster
Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
OK, I'm sold on using icecream to compile large builds like kernel packages.

Using icecream I combined my desktop and my Plex NUC. Pat's kernel build scripts went from 2 hours 56 minutes on only my desktop to 1 hour 50 minutes on the distributed compile pair. Since all my machines are low powered, low noise I'll add another PC or 2 to reduce the time even more.

Gotta love finding useful tools Pat makes available to Slackware users.
 
Old 03-01-2021, 03:23 AM   #11
Martinus2u
Member
 
Registered: Apr 2010
Distribution: Slackware
Posts: 497

Rep: Reputation: 119Reputation: 119
Guys, the kernel build times depend heavily on the kernel config and kernel version. For a meaningful comparison everybody needs to agree on the same parameters.

For reference, I've just built a 5.11.2 kernel essentially with full slackware generic kernel config in 4 minutes 33 seconds (Ryzen 5950X)

In the past I have used distcc to great effect, but distcc obviously works best when you have a number of machines of similar performance. If one machine is significantly faster than the others, you might as well build on the fast machine alone.
 
2 members found this post helpful.
Old 03-01-2021, 05:26 AM   #12
karlmag
Member
 
Registered: Apr 2014
Distribution: Slackware
Posts: 127

Rep: Reputation: Disabled
Quote:
Originally Posted by Martinus2u View Post
Guys, the kernel build times depend heavily on the kernel config and kernel version. For a meaningful comparison everybody needs to agree on the same parameters.

For reference, I've just built a 5.11.2 kernel essentially with full slackware generic kernel config in 4 minutes 33 seconds (Ryzen 5950X)

In the past I have used distcc to great effect, but distcc obviously works best when you have a number of machines of similar performance. If one machine is significantly faster than the others, you might as well build on the fast machine alone.
Yeah, for actual 1-to-1 comparison you will need to compare the exact same compile on different computers.
I would argue that dot-versions of the kernels which are not too far apart (like maybe 3-5 releases or so) should normally give fairly similar compile times, given same/very similar configs, but obviously YMMV on that. Should give you an indication at least. Only the very same config and kernel version is straight up directly comparable.


I can't speak for distcc, but I have tested icecream a little bit, and it can speed up the compiles significantly - depending on what hardware you have available. As indicated, how well it works will depend on the differences between the computers you have available. Up to the point that some might actually slow down the overall compile. Some testing will figure that out for you. How helpful slow(er) machines are will also depend on the actual compile job. I would think that the bigger the compile job, the more helpful the slower nodes might be. Again, running tests to find out.

AFAIK Pat uses an icecream cluster for his compiles.

Thanks
--
KarlMag
 
Old 03-01-2021, 05:32 AM   #13
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
If I had to guess you missed the make -jN flag (parallel build).
 
Old 03-01-2021, 06:17 AM   #14
karlmag
Member
 
Registered: Apr 2014
Distribution: Slackware
Posts: 127

Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
If I had to guess you missed the make -jN flag (parallel build).
If he uses the -current trees' build scripts, in all the k/*.SlackBuild scripts you have this;
NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}

So, it should automagically figure out how many threads you have, add one and use that as you 'N'.


(Obviously - for a distributed (distcc/icecream) build you would have to set that number to something suitable yourself.)

Thanks
--
KarlMag
 
Old 03-01-2021, 08:10 AM   #15
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 928

Rep: Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515
Here it takes about 5 minutes to build the kernel (5.11) with config-generic,
and about 35 minutes to build 'bzImage modules'.
I run 'make -j9', CPU is an AMD FX-8320E (eight cores).
 
2 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Linux 4.4 seems to refuse to build IPv6 for the 64-bit build - 32-bit build works fine GameCodingNinja Linux From Scratch 2 02-07-2016 06:40 PM
how to understand user time, sys time, wait time, idle time of CPU guixingyi Linux - Server 1 08-24-2010 10:10 AM
LXer: Build 'em Right, Build 'em Strong, Build 'em Linux LXer Syndicated Linux News 0 10-01-2007 09:51 PM
Which is the kernel build directory? I Can't find kernel build files crabsody Debian 7 01-09-2007 04:48 AM
kernel build says build is "dirty"? Quakeboy02 Debian 3 12-18-2006 11:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration