[boinc-client] Fix CPU scheduling priority of BOINC jobs when cgroups are used
Miloš Jakubíček
mjakubicek at fedoraproject.org
Sat Aug 20 16:50:53 UTC 2011
commit 88e2722e67d98feae417e68dde73bff9da1d7d7e
Author: Milos Jakubicek <xjakub at fi.muni.cz>
Date: Sat Aug 20 12:33:03 2011 +0200
Fix CPU scheduling priority of BOINC jobs when cgroups are used
Boinc must be run in a separate cgroup with minimum cpu.share
(fixes BZ#705444)
boinc-client-init-d | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/boinc-client-init-d b/boinc-client-init-d
index 6670e7b..bc59d60 100644
--- a/boinc-client-init-d
+++ b/boinc-client-init-d
@@ -53,6 +53,10 @@ BOINCDIR="/var/lib/boinc"
BOINCEXE="/usr/bin/boinc_client"
BOINCCMD="/usr/bin/boinccmd"
+# Cgroup to be used: this is necessary to ensure low scheduling priority for Boinc
+
+CGROUP_DAEMON="cpu:/background"
+
# Log and error files (should be placed in /var/log/ to avoid SELinux related issues)
LOGFILE="/var/log/boinc.log"
@@ -96,6 +100,11 @@ if [ ! -x $BOINCEXE ]; then
exit 2
fi
+# Create cgroup and set minimum CPU priority
+
+cgcreate -g $CGROUP_DAEMON
+cgset -r cpu.shares=2 `echo $CGROUP_DAEMON | cut -f2 -d:`
+
# Warn if there are no projects attached
cd $BOINCDIR
More information about the scm-commits
mailing list