With the P-State kernel driver one good feature of the old ondemand governor is lost: niced processes (nice -19) formerly did not increase the cpu speed to max, but now this is the case (https://lkml.org/lkml/2013/5/3/376) As an "alternative" the cgroups are proposed, which would need the following changes to the init script: i) boinc depends on dev-libs/libcgroup ii) 3 commands like this has to be run : $> CGROUP_DAEMON="cpu:/background" $> cgcreate -g $CGROUP_DAEMON $> cgset -r cpu.shares=2 `echo $CGROUP_DAEMON | cut -f2 -d:` iii) the init.d script needs something like this to start the boinc process: cgexec -g cpu:background ... What's left however with these (incomplete ?) settings : the cpu speed is set often to max resulting a´in a high temperature of a notebook.
Basically I agree, but there are two things to consider: 1) Does the cgroup setting cascade down to the applications started by the boinc daemon? 2) What about the (many?) users who either use a kernel with BFS scheduler (no cgroups) or have cgroups disabled themselves?
1) definitely yes IMO, due to the autogroup feature of the kernel 2) no idea
Sorry for the long delay. I am currently working on other bugs. Hopefully I have my next pull request ready this afternoon. If it gets accepted, I'll add the cgroups support. For something like BOINC it looks really promising.
Any news?
(In reply to Jonas Stein from comment #4) > Any news? The problem is to have an idea how to do this correctly. - What if a user does not have cgroups support? Make cgroups support mandatory? - Wouldn't it be sufficient to add something like "boinc cpu,memory background" to /etc/cgroup/cgrules.conf? /etc/init.d/cgred would have to run anyway, right? However, even if the usage of cgexec is not needed, the init script must at least create and configure the cgroup.
Actually I think it is sufficient to add -------- group background { cpu { cpu.shares="8"; } memory { memory.limit_in_bytes="16G"; memory.memsw.limit_in_bytes="24G"; } } -------- to /etc/cgroup/cgconfig.conf, this is my config on an 8 core notebook with 32GB RAM, and to add -------- @boinc cpu,memory background -------- to /etc/cgroup/cgrules.conf. All processes started by someone in the boinc group are then handled by cpu/background and cpu/background.
(In reply to Sven Eden from comment #6) > Actually I think it is sufficient to add > > -------- > group background { > cpu { > cpu.shares="8"; > } > memory { > memory.limit_in_bytes="16G"; > memory.memsw.limit_in_bytes="24G"; > } > } > -------- > > to /etc/cgroup/cgconfig.conf, this is my config on an 8 core notebook with > 32GB RAM, and to add > > -------- > @boinc cpu,memory background > -------- > > to /etc/cgroup/cgrules.conf. All processes started by someone in the boinc > group are then handled by cpu/background and cpu/background. This is not portable. How about users with different CPU/RAM amounts? Anyway, there are people not using cgroups (including myself), so nice should be available as fallback. BTW, if one wants to save battery, why to run BOINC in the first place? I always thought it is for desktops/servers with resources wasted otherwise.
(In reply to Andrew Savchenko from comment #7) > > to /etc/cgroup/cgconfig.conf, this is my config on an 8 core notebook with > > 32GB RAM, and to add > > > > -------- > > @boinc cpu,memory background > > -------- > > > > to /etc/cgroup/cgrules.conf. All processes started by someone in the boinc > > This is not portable. How about users with different CPU/RAM amounts? Of course not. Every user who wants cgroups can set this up for themselves without any change needed on the boinc init script. It really can not decide for you how to set it up. I could add this stuff to the init script, setting everything up manually, and steered through /etc/conf.d/boinc, but I couldn't even come up with sane defaults. > Anyway, there are people not using cgroups (including myself), so nice > should be available as fallback. Yes. That's why I thought about this manual DIY-approach. > BTW, if one wants to save battery, why to run BOINC in the first place? I > always thought it is for desktops/servers with resources wasted otherwise. BOINC goes into suspend mode when running on battery. At least that's the default. Users can change that on their own discretion of course...
(In reply to Sven Eden from comment #8) > Of course not. Every user who wants cgroups can set this up for themselves > without any change needed on the boinc init script. It really can not decide > for you how to set it up. Ah, OK. Sorry I misunderstood you, I though you're suggesting these values as defaults for everyone.
I am closing this, because I can not find a simple solution that does not result in a no-fit for most users. The setup of cgroups to control cpu and memory shares are highly dependent on the target machines layout, both hardware and other cgroups configurations, that it is best to let users configure this themselves (this is actually quite easy) if they care. Please feel free to re-open this bug if a simple solution crosses your path.