1
0
Fork 0

cpu-partitioning: store helper state file to /run and few other tweaks

Helper state file for cpu-partitioning script was moved to /run/tuned.
Code for flags manipulation has been simplified.
The /run/tuned directory is explicitly cleared upon uninstallation
of Tuned to get rid of all leftovers / helper files before the reboot.
Added STORAGE_PERSISTENT variable pointing to /var/lib/tuned into
functions to be consistent.

Related: rhbz#1497182

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
Jaroslav Škarvada 2017-10-20 15:13:45 +02:00
parent b39c2af9db
commit c91357cdf5
No known key found for this signature in database
GPG key ID: D8E1C00E076E840B
3 changed files with 6 additions and 3 deletions

View file

@ -2,7 +2,7 @@
. /usr/lib/tuned/functions
rebalance_cpus_file=no-rebalance-cpus.txt
rebalance_cpus_file=$STORAGE/no-rebalance-cpus.txt
change_sd_balance_bit()
{
@ -15,9 +15,9 @@ change_sd_balance_bit()
for file in $(find /proc/sys/kernel/sched_domain/cpu$cpu -name flags -print); do
flags_cur=$(cat $file)
if [ $set_bit -eq 1 ]; then
flags_cur=$(echo $((flags_cur | 0x1)))
flags_cur=$((flags_cur | 0x1))
else
flags_cur=$(echo $((flags_cur & 0xfffe)))
flags_cur=$((flags_cur & 0xfffe))
fi
echo $flags_cur > $file
done

View file

@ -8,6 +8,7 @@
# Config
#
STORAGE=/run/tuned
STORAGE_PERSISTENT=/var/lib/tuned
STORAGE_SUFFIX=".save"
#

View file

@ -210,6 +210,8 @@ fi
if [ "$1" == 0 ]; then
# clear persistent storage
rm -f %{_var}/lib/tuned/*
# clear temporal storage
rm -f /run/tuned/*
fi