diff options
author | Michal Sekletár <msekleta@redhat.com> | 2020-02-17 13:50:31 +0100 |
---|---|---|
committer | Michal Sekletár <msekleta@redhat.com> | 2020-03-16 08:57:28 +0100 |
commit | e2b2fb7f566d13a3de61952b5356cd4d2eaee917 (patch) | |
tree | 3ab1e0c2ee7358be71c1197b16f95391ad7f1487 /test | |
parent | 1808f76870d8368542f058b99df89cf0a4a2d011 (diff) | |
download | systemd-e2b2fb7f566d13a3de61952b5356cd4d2eaee917.tar.gz |
core: add support for setting CPUAffinity= to special "numa" value
systemd will automatically derive CPU affinity mask from NUMA node
mask.
Fixes #13248
Diffstat (limited to 'test')
-rwxr-xr-x | test/TEST-36-NUMAPOLICY/testsuite.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/TEST-36-NUMAPOLICY/testsuite.sh b/test/TEST-36-NUMAPOLICY/testsuite.sh index 4a2bede431..bd04bb2efe 100755 --- a/test/TEST-36-NUMAPOLICY/testsuite.sh +++ b/test/TEST-36-NUMAPOLICY/testsuite.sh @@ -279,6 +279,18 @@ else # Maks must be ignored grep -E "set_mempolicy\((MPOL_LOCAL|0x4 [^,]*), NULL" $straceLog + echo "Unit file CPUAffinity=NUMA support" + writeTestUnitNUMAPolicy "bind" "0" + echo "CPUAffinity=numa" >> $testUnitNUMAConf + systemctl daemon-reload + systemctl start $testUnit + systemctlCheckNUMAProperties $testUnit "bind" "0" + pid=$(systemctl show --value -p MainPID $testUnit) + cpulist=$(cat /sys/devices/system/node/node0/cpulist) + affinity_systemd=$(systemctl show --value -p CPUAffinity $testUnit) + [ $cpulist = $affinity_systemd ] + pid1StopUnit $testUnit + echo "systemd-run NUMAPolicy support" runUnit='numa-systemd-run-test.service' @@ -309,6 +321,12 @@ else systemd-run -p NUMAPolicy=local -p NUMAMask=0 --unit $runUnit sleep 1000 systemctlCheckNUMAProperties $runUnit "local" "" pid1StopUnit $runUnit + + systemd-run -p NUMAPolicy=local -p NUMAMask=0 -p CPUAffinity=numa --unit $runUnit sleep 1000 + systemctlCheckNUMAProperties $runUnit "local" "" + systemctl cat $runUnit | grep -q 'CPUAffinity=numa' + pid1StopUnit $runUnit + fi # Cleanup |