Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Cant nice processes properly
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Frostwarrior
Apprentice
Apprentice


Joined: 02 Mar 2007
Posts: 165

PostPosted: Sat Mar 21, 2009 5:55 am    Post subject: [SOLVED] Cant nice processes properly Reply with quote

Hi all.
Im having troubles with the niceness settings of portage.

I set portage niceness to 10.
In gentoo, emerging and compiling takes me over half cpu even with portage niceness with value of 10.
I recently started and chrooted to gentoo in a ubuntu environment. In the ubuntu box, compiling was really slow, but it was slow because ubuntu took all the processing power from the niced emerge task to speed up my main activities. And that's what i want :P

There is anything wrong with my gentoo box?

Thanks in advance for the answers.


Last edited by Frostwarrior on Sun Mar 22, 2009 1:15 am; edited 1 time in total
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3943
Location: Hamburg

PostPosted: Sat Mar 21, 2009 9:09 am    Post subject: Reply with quote

If you use the CPU ondemand governor, don#t forget to make
Code:
echo 1 >  /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice_load
however if you use the CONFIG_FAIR_GROUP_SCHED you'll hav emuch more to do, see /usr/src/linux/Documentation/scheduler/sched-design-CFS.txt
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23193

PostPosted: Sat Mar 21, 2009 5:29 pm    Post subject: Reply with quote

Making a process nice only means that the scheduler will bias its choices away from the nice process. It does not impose a cap on CPU usage. A nice process can use 100% CPU time if nothing else needs to run. You say that the nice process is taking "over half cpu". What do you mean by that? Are you seeing CPU usage in excess of 50% of your capacity, or that your normal activities are being degraded when Portage runs? If you are seeing degradation, are you sure it is due to CPU load, and not I/O load? Compiling complex programs can require a substantial amount of disk access to read in all the headers and libraries, write out object files, and so on.

If none of that helps you solve the problem, please tell us what CPU scheduler and I/O scheduler you are using in both the good and bad environment.
Back to top
View user's profile Send private message
Frostwarrior
Apprentice
Apprentice


Joined: 02 Mar 2007
Posts: 165

PostPosted: Sat Mar 21, 2009 5:54 pm    Post subject: Reply with quote

toralf wrote:
If you use the CPU ondemand governor, don#t forget to make
Code:
echo 1 >  /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice_load
however if you use the CONFIG_FAIR_GROUP_SCHED you'll hav emuch more to do, see /usr/src/linux/Documentation/scheduler/sched-design-CFS.txt


Thanks toraIf, but i have no CPU governor (and no cpufreq scaling).

Quote:
A nice process can use 100% CPU time if nothing else needs to run. You say that the nice process is taking "over half cpu". What do you mean by that? Are you seeing CPU usage in excess of 50% of your capacity, or that your normal activities are being degraded when Portage runs?


With "taking over half cpu" i mean "when i use my apps with no niceness, they are degraded with the niced portage".
In other words, "your normal activities are being degraded when Portage runs" :)

Quote:
If you are seeing degradation, are you sure it is due to CPU load, and not I/O load? Compiling complex programs can require a substantial amount of disk access to read in all the headers and libraries, write out object files, and so on.

Because im comparing flash in firefox (which is very heavy on cpu cycles) and compiling a program. Flash may be heavy, but uses almost no disk.

Quote:
If none of that helps you solve the problem, please tell us what CPU scheduler and I/O scheduler you are using in both the good and bad environment.

I'm looking in the menuconfig, but i don't know how to find this data.
Can you give me a tip?
Back to top
View user's profile Send private message
Frostwarrior
Apprentice
Apprentice


Joined: 02 Mar 2007
Posts: 165

PostPosted: Sun Mar 22, 2009 1:14 am    Post subject: Reply with quote

Well, i've resolved the problem.

I only copied the kernel configuration of ubuntu surrounding the cpu scheduler and applied it in my gentoo kernel.

Code:
General Setup --->

*[*] Control Group support           
[ ]   Example debug cgroup subsystem
*[*]   Namespace cgroup subsystem   
[ ]   Device controller for cgroups
[*] Group CPU scheduler                                 
[*]   Group scheduling for SCHED_OTHER                 
*[*]   Group scheduling for SCHED_RR/FIFO           
*      Basis for grouping tasks (Control groups)  --->   
*[*] Simple CPU accounting cgroup subsystem             
*[*] Resource counters                                   
*[*] Memory Resource Controller for Control Groups       
[ ] Create deprecated sysfs files                       
[*] Kernel->user space relay support (formerly relayfs)


Those starting with an * are the options i enabled.

Now i can use my desktop without problems while portage does his work :)
Next thing to do is to be a good admin and read about the changes i made :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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