kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
To: Harsh chopra <serviceprovider.tester@gmail.com>
Cc: kernelnewbies@kernelnewbies.org
Subject: Re: Computing resources required for kernel development
Date: Sun, 31 May 2020 04:16:33 -0400	[thread overview]
Message-ID: <32604.1590912993@turing-police> (raw)
In-Reply-To: <CAPEbqj580U7DzZgKiH7kzU1iWtyMBZBS-C_XjrnQCeKYLUXM8g@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2938 bytes --]

On Sat, 30 May 2020 20:56:21 +0530, Harsh chopra said:

> I have been following the Kernel Hacking steps to submit my first patch but
> I am facing problem in the kernel compilation as its taking more than a day
> may be due to low computing resources..

On a Raspberry Pi 4 with 4G of RAM, overclocked to 2Ghz, and using a 256G USB3
SSD as the system disk instead of an SD card, a 'make allmodconfig' has to
build 28,302 .o files and from a tree that had a 'make clean', a 'make' takes:

real	585m58.387s
user	537m15.917s
sys	65m59.296s

Note that the RPi4 has 4 cores, so a 'make -j4' will go even faster, but you
will need a case that provides cooling for the CPU/GPU, especially if
overclocked. (And just a few days ago, the RPi crew dropped a new firmware that
allows booting straight from a USB device, so no SD card is needed at all)

Meanwhile, a config for my laptop that's been somewhat minimized by
using 'make localmodconfig' only has to build 4,996 .o files (and I could probably
trim that back a whole bunch), which makes kernel builds about 8 times faster than
an 'allmodconfig' :)

How to:
Step 1 - boot a current kernel.
Step 2 - plug in any and all USB disks, cameras, keyboards/mice and anything
else that you might have, so their drivers get loaded. Make sure that you get
everything, because if you miss something, the device won't work because there
won't be a driver.
Step 3 - cd to wherever you're doing your kernel builds
Step 4 - 'make localmodconfig'
Step 5 - make and install your new kernel config.

Note that if you're doing patches for code in modules you don't have loaded, you
may need to go do 'make menuconfig' to enable building the the module. 

> I have Ubuntu 20.04 LTS with 4GB  DDR3 ram 1 TB HDD, Intel i3  2.GHZ and 4
> cores but I have been using virt-manager for the kernel development with
> CentOS 8.1 (minimal req.) and  resources 70 GB storage, 2 GB ram and 2
> cores.

That's not that much different from the RPi I mentioned above except for the
HDD rather than an SSD.  Note that even a smaller SSD for just your kernel
source will get you most of the bang for your buck, because gcc, the most
heavily used *.h files, and other stuff like that should remain in memory so
after the first few modules are compiled, pretty much all your disk I/O is for
*.c files from the source tree.   And although USB3 is preferable, you'll get
a speedup even if you only have USB2 ports available.

> Thus if anyone could suggest how much computing power to have or any other
> method so that I could make my development process smooth.

Work smarter, not harder.

The two biggest things you can do to speed things up are getting an SSD for
your system disk, and 'localmodconfig' to minimize the amount of extraneous
stuff you have to build.  The SSD may be more money than you're willing
to spend, but the other suggestion is essentially free.

[-- Attachment #1.2: Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

      parent reply	other threads:[~2020-05-31  8:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-30 15:26 Computing resources required for kernel development Harsh chopra
2020-05-30 18:44 ` Suraj Upadhyay
2020-05-31  6:12   ` Harsh chopra
2020-05-31  6:29     ` Greg KH
2020-05-31  8:16 ` Valdis Klētnieks [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=32604.1590912993@turing-police \
    --to=valdis.kletnieks@vt.edu \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=serviceprovider.tester@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).