blob: d30a3d6e4bffe174cb67e8c81e5d067fb27ce690 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#! /usr/bin/env bash
source "/etc/libvirt/hooks/cpuset.conf"
if test -f $CPUSET_REFCOUNT;
then
ref=$(tail -1 $CPUSET_REFCOUNT)
dec=$(expr $ref - 1)
printf "%06d" $(expr $dec) > $CPUSET_REFCOUNT
if [ $dec -gt 0 ];
then
exit 0
fi
rm $CPUSET_REFCOUNT
else
exit 1
fi
if test -d ${CPUSET}/${SETNAME};
then
sed -un p < ${CPUSET}/${SETNAME}/tasks > ${CPUSET}/tasks
rmdir ${CPUSET}/${SETNAME}
fi
for i in blkio cpu cpuacct cpuset devices freezer memory net_cls perf_event;
do
rmdir ${CGROUP}/$i/machine/${PARTNAME0}.partition
rmdir ${CGROUP}/$i/machine/${PARTNAME1}.partition
done
/bin/echo ${TOTAL_CORES} > ${CPUSET}/machine/cpuset.cpus
# (pgrep kthreadd) = 2
taskset -pc ${TOTAL_CORES} 2
|