Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Compilation doesn't use available resources
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
dkuflu
n00b
n00b


Joined: 14 Jun 2022
Posts: 10

PostPosted: Thu Jun 23, 2022 8:32 am    Post subject: [SOLVED] Compilation doesn't use available resources Reply with quote

I have installed Gentoo a week ago, and noticed that packages take a long time to compile. So, I decided to check my system's resource usage during compilation and noticed that it only uses 10-20% of my 16GB RAM, even though I have set -j8 in my make.conf. I have also noticed that my 4GHz CPU only runs at 800MHz during compilation. I checked my resource usage using btop.

Here's a photo of btop during compilation: https://paste.pics/4b98e9a214287d1be5167d50f3d50a2a

My make.conf: https://pastebin.pl/view/ed7752fb

My kernel config: https://pastebin.pl/view/a4155115


Last edited by dkuflu on Thu Jun 23, 2022 4:09 pm; edited 1 time in total
Back to top
View user's profile Send private message
Josef.95
Advocate
Advocate


Joined: 03 Sep 2007
Posts: 4185
Location: Germany

PostPosted: Thu Jun 23, 2022 9:08 am    Post subject: Reply with quote

Hi
kernel config wrote:
Code:
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
CONFIG_CPU_FREQ_GOV_COMMON=y
# CONFIG_CPU_FREQ_STAT is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y

CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
is probably the "problem"
I would change it to
CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 3813
Location: Frankfurt, Germany

PostPosted: Thu Jun 23, 2022 11:41 am    Post subject: Reply with quote

Josef.95 wrote:
I would change it to
CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y

Most probably, that will solve the issue. The command below switches the governor temporarily - until the next boot:
Code:
cpupower frequency-set -g schedutil

We've had a couple of users who suffered from this bug. See:
  1. https://forums.gentoo.org/viewtopic-t-1147736.html
  2. https://forums.gentoo.org/viewtopic-t-1147952.html
  3. https://forums.gentoo.org/viewtopic-t-1149827.html
  4. https://bugs.gentoo.org/832224
Back to top
View user's profile Send private message
dkuflu
n00b
n00b


Joined: 14 Jun 2022
Posts: 10

PostPosted: Thu Jun 23, 2022 1:24 pm    Post subject: Reply with quote

Setting CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y solved the issue for me. However, compiling still uses at most 30-35% of my RAM (tested compiling Firefox). In the Gentoo Handbook, I've read that while compiling each CPU thread can use up to 2GB of RAM. Is there another setting I should do?
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 3813
Location: Frankfurt, Germany

PostPosted: Thu Jun 23, 2022 3:39 pm    Post subject: Reply with quote

"up to 2GB" does not mean "always 2GB".

Most packages need much less than 2GB per process. But there are a few packages - mostly packages written in C++ or Rust - that really need 2 GB per process. *webengige*, *webkit* and LibreOffice come to my mind...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum