this post was submitted on 27 Nov 2023
9 points (100.0% liked)

Debian operating system

2744 readers
24 users here now

Debian is a free operating system (OS) for your computer. An operating system is the set of basic programs and utilities that make your computer run. Debian provides more than a pure OS: it comes with over 59000 packages, precompiled software bundled up in a nice format for easy installation on your machine.

founded 4 years ago
MODERATORS
 

Hi, I am building the Linux kernel, with the following make command to enable multi core compilation: make -j. This ends up freezing the system and eventually some applications get killed (I am using KDE). If I pass an argument to -j, then system compiles normally. However, full multi-core compilation is enabled when no argument is specified.

I am on Debian stable, kernel 6.1.0-13-amd64. Is there a way make system do full multi-core compilation without freezing the system?

you are viewing a single comment's thread
view the rest of the comments
[–] mlfh@lemmy.ml 8 points 1 year ago* (last edited 1 year ago) (2 children)

Make's -j option specifies the number of concurrent jobs to run, and without an argument doesn't limit that number at all. Usually you pass an argument to it with the number of cpu cores you want to utilize. Going over the number of cores you have available (like it does without an argument) will be slower or even freeze your system with all the context switching it has to do.

[–] jayaura@discuss.tchncs.de 3 points 1 year ago (1 children)

Using the exact number of cores I have as the argument (from /proc/cpuinfo) makes the compilation go smooth. Are you saying that without an argument, Make uses a very high default number that causes other processes to starve ? Nevertheless, kernel shouldnt allow such a situation as far as I understrand, and perhaps should be considered a bug in the kernel ?

[–] mlfh@lemmy.ml 4 points 1 year ago

Without an argument, the -j option will start jobs with no limits - depending on the project, this could be thousands or tens of thousands of processes at once. The kernel will do its best to manage this, but when your interface is competing for cpu resources with 10,000 other cpu-intensive processes, it will appear frozen.