Bug 705444 - BOINC client does not correctly obey nice level
Summary: BOINC client does not correctly obey nice level
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: boinc-client
Version: 15
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Milos Jakubicek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-17 17:38 UTC by Andris Pavenis
Modified: 2012-02-08 22:56 UTC (History)
3 users (show)

Fixed In Version: boinc-client-6.12.35-1.r24014svn.fc15
Clone Of:
Environment:
Last Closed: 2011-12-12 22:04:20 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Andris Pavenis 2011-05-17 17:38:32 UTC
Description of problem:

I noticed that on 2 different systems upgraded to Fedora 15pre x86_64 BOINC projects does not obey nice settings when system has another load. Both systems
have dual core CPUs. 

Version-Release number of selected component (if applicable):

boinc-client-6.10.58-3.r22930.fc15.x86_64
kernel 2.6.38.5-24.fc15.x86_64

How reproducible:

Always


Steps to Reproduce:
1. start BOINC client and have some BOINC projects running
2. start some other process with the default priority (I used 2 copies
    of simple C++ program that wastes CPU time like 'while(true){}'
  
Actual results:

top shows that boinc projects are getting about same amount of CPU time
as ather processes running with the default priority (see snapshot of top
output below)

Expected results:

BOINC projects are expected to get several % of CPU time when there are
processes with normal priority requiring enough CPU time.

Additional info:

1) snapshot for top on one of these Fedora 15 x86_64 systems:
top - 20:06:58 up 30 min,  7 users,  load average: 3.84, 3.53, 2.69
Tasks: 179 total,   5 running, 174 sleeping,   0 stopped,   0 zombie
Cpu(s): 51.7%us,  3.0%sy, 45.3%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   4024908k total,  2202032k used,  1822876k free,    42092k buffers
Swap:  4395004k total,        0k used,  4395004k free,   937132k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                 
 6807 andris    20   0 11828  688  572 R 48.5  0.0   0:11.55 wastecpu                
 6806 andris    20   0 11828  688  572 R 46.5  0.0   0:12.88 wastecpu                
 2700 boinc     39  19  216m 211m 2660 R 44.6  5.4  19:32.91 einsteinbinary_         
 3213 boinc     39  19  267m 261m 1356 R 43.6  6.7  15:39.84 einstein_S5GC1H         
 1721 root      20   0  187m  30m  12m S  3.0  0.8   1:40.41 X                       

Tried to renice boinc project executable to 10. In this case it got about
70% of CPU time of 1 core.

nice seems to work OK between several my processes

So it seems that nice 19 for boinc processes acts as nice 0 of normal user
process.

This is clear regression in comparisson with Fedora 14 x86_64 (and earliers)
where I have necer observed similar behaviour.

Comment 1 Andris Pavenis 2011-05-20 03:42:50 UTC
The problem is how to configure BOINC to run as real background task when systemd and cgroups are being used. boinc-client package should be configured in that way, so after installation (or upgrade) it would run really in background instead of getting the same cpu time share as all some other normal user processes together.

Comment 2 Andris Pavenis 2011-05-30 09:53:11 UTC
Workarounded problem by
1) adding backgromg CGROUP

--- /etc/cgconfig.conf-20110526 2011-05-26 08:49:07.794303903 +0300
+++ /etc/cgconfig.conf  2011-05-26 08:49:49.666429924 +0300
@@ -24,3 +24,8 @@
        net_cls = /sys/fs/cgroup/net_cls;
 }
 
+group background {
+       cpu {
+               cpu.shares = 1;
+       }
+}

2) telling boinc-client service to use cpu:/background group

--- /etc/sysconfig/boinc-client-20110526        2011-05-26 08:51:06.530832500 +0300
+++ /etc/sysconfig/boinc-client 2011-05-26 08:51:37.530188219 +0300
@@ -40,3 +40,5 @@
 #BOINCOPTS="--check_all_logins"
 # The default is no options.
 #BOINCOPTS=
+
+CGROUP_DAEMON="cpu:/background"


After that BOINC client seems to work OK in background (tested on 2
systems: both Fedora 15 x86_64)

I guess it would be good idea if this would happen automatically without need
to additionally hack config files.

Comment 3 Andris Pavenis 2011-06-03 16:05:49 UTC
It seems that setup mentioned above is highly unreliable
- starting cgconfig.service often fails at boot time and as result
   cpu:/background group is not created
- it is often impossible to start cgconfig.service also manually (it simply
   fails, no matter what I tried:
      - systemctl start cgconfig.service
      - service cgconfig start
      - /etc/init.d/cgconfig start
   also with attempting to stop it at first

In these cases boinc-client service does not start (well I'm getting message
that it is started, but 'systemctl status boinc-client.service' says that it has
exited with return code 0)

So I reverted modifications to /etc/cgconfig.conf and put the following
into /etc/sysconfig/boinc-client:

------------------------------------------------------------
if ! [ -d /sys/fs/cgroup/cpu/background ] ; then
    mkdir -p /sys/fs/cgroup/cpu/background
    echo 1 >/sys/fs/cgroup/cpu/background/cpu.shares
fi

CGROUP_DAEMON="cpu:/background"
------------------------------------------------------------
(the idea is taken from 'man cgconfig.conf')

Comment 4 Milos Jakubicek 2011-08-20 10:40:30 UTC
Andris,

thank you very much for your detailed bugreport and sorry for the delay. I'm about to release a boinc update that solves this issue (using more or less your solution, except for some details -- minimum allowed cpu.share is 2 and I use the cg* tools to manipulate cgroups + configuration is in the init script so that it can be overridden by user in sysconfig file).

Comment 5 Fedora Update System 2011-08-20 18:10:33 UTC
boinc-client-6.12.35-1.r24014svn.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/boinc-client-6.12.35-1.r24014svn.fc16

Comment 6 Fedora Update System 2011-08-20 18:13:56 UTC
boinc-client-6.12.35-1.r24014svn.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/boinc-client-6.12.35-1.r24014svn.fc15

Comment 7 Fedora Update System 2011-08-22 18:34:55 UTC
Package boinc-client-6.12.35-1.r24014svn.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing boinc-client-6.12.35-1.r24014svn.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/boinc-client-6.12.35-1.r24014svn.fc16
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2011-12-12 22:04:20 UTC
boinc-client-6.12.35-1.r24014svn.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2012-02-08 22:56:46 UTC
boinc-client-6.12.35-1.r24014svn.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.