|
|
5d2ee9 |
From 8239ecf0b4b8bbe5b3c17964d230d13cee4d900a Mon Sep 17 00:00:00 2001
|
|
|
5d2ee9 |
From: Frantisek Sumsal <frantisek@sumsal.cz>
|
|
|
5d2ee9 |
Date: Mon, 5 Aug 2019 14:38:45 +0200
|
|
|
5d2ee9 |
Subject: [PATCH 339/341] test: add a simple sanity check for systems without
|
|
|
5d2ee9 |
NUMA support
|
|
|
5d2ee9 |
|
|
|
5d2ee9 |
(cherry picked from commit 92f8e978923f962a57d744c5f358520ac06f7892)
|
|
|
5d2ee9 |
|
|
|
5d2ee9 |
Related: #1808940
|
|
|
5d2ee9 |
---
|
|
|
5d2ee9 |
test/TEST-36-NUMAPOLICY/testsuite.sh | 350 ++++++++++++++-------------
|
|
|
5d2ee9 |
1 file changed, 180 insertions(+), 170 deletions(-)
|
|
|
5d2ee9 |
|
|
|
5d2ee9 |
diff --git a/test/TEST-36-NUMAPOLICY/testsuite.sh b/test/TEST-36-NUMAPOLICY/testsuite.sh
|
|
|
5d2ee9 |
index 1c8cf7e6b6..a5ac788178 100755
|
|
|
5d2ee9 |
--- a/test/TEST-36-NUMAPOLICY/testsuite.sh
|
|
|
5d2ee9 |
+++ b/test/TEST-36-NUMAPOLICY/testsuite.sh
|
|
|
5d2ee9 |
@@ -50,11 +50,12 @@ startJournalctl() {
|
|
|
5d2ee9 |
}
|
|
|
5d2ee9 |
|
|
|
5d2ee9 |
stopJournalctl() {
|
|
|
5d2ee9 |
+ local unit="${1:-init.scope}"
|
|
|
5d2ee9 |
# Using journalctl --sync should be better than using SIGRTMIN+1, as
|
|
|
5d2ee9 |
# the --sync wait until the synchronization is complete
|
|
|
5d2ee9 |
echo "Force journald to write all queued messages"
|
|
|
5d2ee9 |
journalctl --sync
|
|
|
5d2ee9 |
- journalctl -u init.scope --cursor-file="$journalCursorFile" > "$journalLog"
|
|
|
5d2ee9 |
+ journalctl -u $unit --cursor-file="$journalCursorFile" > "$journalLog"
|
|
|
5d2ee9 |
}
|
|
|
5d2ee9 |
|
|
|
5d2ee9 |
checkNUMA() {
|
|
|
5d2ee9 |
@@ -125,181 +126,190 @@ systemctlCheckNUMAProperties() {
|
|
|
5d2ee9 |
fi
|
|
|
5d2ee9 |
}
|
|
|
5d2ee9 |
|
|
|
5d2ee9 |
-if ! checkNUMA; then
|
|
|
5d2ee9 |
- echo >&2 "NUMA is not supported on this machine, skipping the test"
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
- # FIXME: add some sanity checks to verify systemd behaves correctly with
|
|
|
5d2ee9 |
- # NUMA disabled together with NUMAPolicy= and NUMAMask=
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
- systemd-analyze log-level info
|
|
|
5d2ee9 |
- echo OK > /testok
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
- exit 0
|
|
|
5d2ee9 |
-fi
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
writeTestUnit
|
|
|
5d2ee9 |
|
|
|
5d2ee9 |
# Create systemd config drop-in directory
|
|
|
5d2ee9 |
confDir="/etc/systemd/system.conf.d/"
|
|
|
5d2ee9 |
mkdir -p "$confDir"
|
|
|
5d2ee9 |
|
|
|
5d2ee9 |
-echo "PID1 NUMAPolicy support - Default policy w/o mask"
|
|
|
5d2ee9 |
-writePID1NUMAPolicy "default"
|
|
|
5d2ee9 |
-pid1ReloadWithStrace
|
|
|
5d2ee9 |
-# Kernel requires that nodemask argument is set to NULL when setting default policy
|
|
|
5d2ee9 |
-grep "set_mempolicy(MPOL_DEFAULT, NULL" $straceLog
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-echo "PID1 NUMAPolicy support - Default policy w/ mask"
|
|
|
5d2ee9 |
-writePID1NUMAPolicy "default" "0"
|
|
|
5d2ee9 |
-pid1ReloadWithStrace
|
|
|
5d2ee9 |
-grep "set_mempolicy(MPOL_DEFAULT, NULL" $straceLog
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-echo "PID1 NUMAPolicy support - Bind policy w/o mask"
|
|
|
5d2ee9 |
-writePID1NUMAPolicy "bind"
|
|
|
5d2ee9 |
-pid1ReloadWithJournal
|
|
|
5d2ee9 |
-grep "Failed to set NUMA memory policy: Invalid argument" $journalLog
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-echo "PID1 NUMAPolicy support - Bind policy w/ mask"
|
|
|
5d2ee9 |
-writePID1NUMAPolicy "bind" "0"
|
|
|
5d2ee9 |
-pid1ReloadWithStrace
|
|
|
5d2ee9 |
-grep -P "set_mempolicy\(MPOL_BIND, \[0x0*1\]" $straceLog
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-echo "PID1 NUMAPolicy support - Interleave policy w/o mask"
|
|
|
5d2ee9 |
-writePID1NUMAPolicy "interleave"
|
|
|
5d2ee9 |
-pid1ReloadWithJournal
|
|
|
5d2ee9 |
-grep "Failed to set NUMA memory policy: Invalid argument" $journalLog
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-echo "PID1 NUMAPolicy support - Interleave policy w/ mask"
|
|
|
5d2ee9 |
-writePID1NUMAPolicy "interleave" "0"
|
|
|
5d2ee9 |
-pid1ReloadWithStrace
|
|
|
5d2ee9 |
-grep -P "set_mempolicy\(MPOL_INTERLEAVE, \[0x0*1\]" $straceLog
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-echo "PID1 NUMAPolicy support - Preferred policy w/o mask"
|
|
|
5d2ee9 |
-writePID1NUMAPolicy "preferred"
|
|
|
5d2ee9 |
-pid1ReloadWithJournal
|
|
|
5d2ee9 |
-# Preferred policy with empty node mask is actually allowed and should reset allocation policy to default
|
|
|
5d2ee9 |
-! grep "Failed to set NUMA memory policy: Invalid argument" $journalLog
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-echo "PID1 NUMAPolicy support - Preferred policy w/ mask"
|
|
|
5d2ee9 |
-writePID1NUMAPolicy "preferred" "0"
|
|
|
5d2ee9 |
-pid1ReloadWithStrace
|
|
|
5d2ee9 |
-grep -P "set_mempolicy\(MPOL_PREFERRED, \[0x0*1\]" $straceLog
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-echo "PID1 NUMAPolicy support - Local policy w/o mask"
|
|
|
5d2ee9 |
-writePID1NUMAPolicy "local"
|
|
|
5d2ee9 |
-pid1ReloadWithStrace
|
|
|
5d2ee9 |
-# Kernel requires that nodemask argument is set to NULL when setting default policy
|
|
|
5d2ee9 |
-# The unpatched versions of strace don't recognize the MPOL_LOCAL constant and
|
|
|
5d2ee9 |
-# return a numerical constant instead (with a comment):
|
|
|
5d2ee9 |
-# set_mempolicy(0x4 /* MPOL_??? */, NULL, 0) = 0
|
|
|
5d2ee9 |
-# Let's cover this scenario as well
|
|
|
5d2ee9 |
-grep -E "set_mempolicy\((MPOL_LOCAL|0x4 [^,]*), NULL" $straceLog
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-echo "PID1 NUMAPolicy support - Local policy w/ mask"
|
|
|
5d2ee9 |
-writePID1NUMAPolicy "local" "0"
|
|
|
5d2ee9 |
-pid1ReloadWithStrace
|
|
|
5d2ee9 |
-grep -E "set_mempolicy\((MPOL_LOCAL|0x4 [^,]*), NULL" $straceLog
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-echo "Unit file NUMAPolicy support - Default policy w/o mask"
|
|
|
5d2ee9 |
-writeTestUnitNUMAPolicy "default"
|
|
|
5d2ee9 |
-pid1StartUnitWithStrace $testUnit
|
|
|
5d2ee9 |
-systemctlCheckNUMAProperties $testUnit "default"
|
|
|
5d2ee9 |
-pid1StopUnit $testUnit
|
|
|
5d2ee9 |
-grep "set_mempolicy(MPOL_DEFAULT, NULL" $straceLog
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-echo "Unit file NUMAPolicy support - Default policy w/ mask"
|
|
|
5d2ee9 |
-writeTestUnitNUMAPolicy "default" "0"
|
|
|
5d2ee9 |
-pid1StartUnitWithStrace $testUnit
|
|
|
5d2ee9 |
-systemctlCheckNUMAProperties $testUnit "default" "0"
|
|
|
5d2ee9 |
-pid1StopUnit $testUnit
|
|
|
5d2ee9 |
-# Maks must be ignored
|
|
|
5d2ee9 |
-grep "set_mempolicy(MPOL_DEFAULT, NULL" $straceLog
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-echo "Unit file NUMAPolicy support - Bind policy w/o mask"
|
|
|
5d2ee9 |
-writeTestUnitNUMAPolicy "bind"
|
|
|
5d2ee9 |
-pid1StartUnitWithJournal $testUnit
|
|
|
5d2ee9 |
-pid1StopUnit $testUnit
|
|
|
5d2ee9 |
-grep "numa-test.service: Main process exited, code=exited, status=242/NUMA" $journalLog
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-echo "Unit file NUMAPolicy support - Bind policy w/ mask"
|
|
|
5d2ee9 |
-writeTestUnitNUMAPolicy "bind" "0"
|
|
|
5d2ee9 |
-pid1StartUnitWithStrace $testUnit
|
|
|
5d2ee9 |
-systemctlCheckNUMAProperties $testUnit "bind" "0"
|
|
|
5d2ee9 |
-pid1StopUnit $testUnit
|
|
|
5d2ee9 |
-grep -P "set_mempolicy\(MPOL_BIND, \[0x0*1\]" $straceLog
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-echo "Unit file NUMAPolicy support - Interleave policy w/o mask"
|
|
|
5d2ee9 |
-writeTestUnitNUMAPolicy "interleave"
|
|
|
5d2ee9 |
-pid1StartUnitWithStrace $testUnit
|
|
|
5d2ee9 |
-pid1StopUnit $testUnit
|
|
|
5d2ee9 |
-grep "numa-test.service: Main process exited, code=exited, status=242/NUMA" $journalLog
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-echo "Unit file NUMAPolicy support - Interleave policy w/ mask"
|
|
|
5d2ee9 |
-writeTestUnitNUMAPolicy "interleave" "0"
|
|
|
5d2ee9 |
-pid1StartUnitWithStrace $testUnit
|
|
|
5d2ee9 |
-systemctlCheckNUMAProperties $testUnit "interleave" "0"
|
|
|
5d2ee9 |
-pid1StopUnit $testUnit
|
|
|
5d2ee9 |
-grep -P "set_mempolicy\(MPOL_INTERLEAVE, \[0x0*1\]" $straceLog
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-echo "Unit file NUMAPolicy support - Preferred policy w/o mask"
|
|
|
5d2ee9 |
-writeTestUnitNUMAPolicy "preferred"
|
|
|
5d2ee9 |
-pid1StartUnitWithJournal $testUnit
|
|
|
5d2ee9 |
-systemctlCheckNUMAProperties $testUnit "preferred"
|
|
|
5d2ee9 |
-pid1StopUnit $testUnit
|
|
|
5d2ee9 |
-! grep "numa-test.service: Main process exited, code=exited, status=242/NUMA" $journalLog
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-echo "Unit file NUMAPolicy support - Preferred policy w/ mask"
|
|
|
5d2ee9 |
-writeTestUnitNUMAPolicy "preferred" "0"
|
|
|
5d2ee9 |
-pid1StartUnitWithStrace $testUnit
|
|
|
5d2ee9 |
-systemctlCheckNUMAProperties $testUnit "preferred" "0"
|
|
|
5d2ee9 |
-pid1StopUnit $testUnit
|
|
|
5d2ee9 |
-grep -P "set_mempolicy\(MPOL_PREFERRED, \[0x0*1\]" $straceLog
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-echo "Unit file NUMAPolicy support - Local policy w/o mask"
|
|
|
5d2ee9 |
-writeTestUnitNUMAPolicy "local"
|
|
|
5d2ee9 |
-pid1StartUnitWithStrace $testUnit
|
|
|
5d2ee9 |
-systemctlCheckNUMAProperties $testUnit "local"
|
|
|
5d2ee9 |
-pid1StopUnit $testUnit
|
|
|
5d2ee9 |
-grep -E "set_mempolicy\((MPOL_LOCAL|0x4 [^,]*), NULL" $straceLog
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-echo "Unit file NUMAPolicy support - Local policy w/ mask"
|
|
|
5d2ee9 |
-writeTestUnitNUMAPolicy "local" "0"
|
|
|
5d2ee9 |
-pid1StartUnitWithStrace $testUnit
|
|
|
5d2ee9 |
-systemctlCheckNUMAProperties $testUnit "local" "0"
|
|
|
5d2ee9 |
-pid1StopUnit $testUnit
|
|
|
5d2ee9 |
-# Maks must be ignored
|
|
|
5d2ee9 |
-grep -E "set_mempolicy\((MPOL_LOCAL|0x4 [^,]*), NULL" $straceLog
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-echo "systemd-run NUMAPolicy support"
|
|
|
5d2ee9 |
-runUnit='numa-systemd-run-test.service'
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-systemd-run -p NUMAPolicy=default --unit $runUnit sleep 1000
|
|
|
5d2ee9 |
-systemctlCheckNUMAProperties $runUnit "default"
|
|
|
5d2ee9 |
-pid1StopUnit $runUnit
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-systemd-run -p NUMAPolicy=default -p NUMAMask=0 --unit $runUnit sleep 1000
|
|
|
5d2ee9 |
-systemctlCheckNUMAProperties $runUnit "default" ""
|
|
|
5d2ee9 |
-pid1StopUnit $runUnit
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-systemd-run -p NUMAPolicy=bind -p NUMAMask=0 --unit $runUnit sleep 1000
|
|
|
5d2ee9 |
-systemctlCheckNUMAProperties $runUnit "bind" "0"
|
|
|
5d2ee9 |
-pid1StopUnit $runUnit
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-systemd-run -p NUMAPolicy=interleave -p NUMAMask=0 --unit $runUnit sleep 1000
|
|
|
5d2ee9 |
-systemctlCheckNUMAProperties $runUnit "interleave" "0"
|
|
|
5d2ee9 |
-pid1StopUnit $runUnit
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-systemd-run -p NUMAPolicy=preferred -p NUMAMask=0 --unit $runUnit sleep 1000
|
|
|
5d2ee9 |
-systemctlCheckNUMAProperties $runUnit "preferred" "0"
|
|
|
5d2ee9 |
-pid1StopUnit $runUnit
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-systemd-run -p NUMAPolicy=local --unit $runUnit sleep 1000
|
|
|
5d2ee9 |
-systemctlCheckNUMAProperties $runUnit "local"
|
|
|
5d2ee9 |
-pid1StopUnit $runUnit
|
|
|
5d2ee9 |
-
|
|
|
5d2ee9 |
-systemd-run -p NUMAPolicy=local -p NUMAMask=0 --unit $runUnit sleep 1000
|
|
|
5d2ee9 |
-systemctlCheckNUMAProperties $runUnit "local" ""
|
|
|
5d2ee9 |
-pid1StopUnit $runUnit
|
|
|
5d2ee9 |
+if ! checkNUMA; then
|
|
|
5d2ee9 |
+ echo >&2 "NUMA is not supported on this machine, switching to a simple sanity check"
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "PID1 NUMAPolicy=default && NUMAMask=0 check without NUMA support"
|
|
|
5d2ee9 |
+ writePID1NUMAPolicy "default" "0"
|
|
|
5d2ee9 |
+ startJournalctl
|
|
|
5d2ee9 |
+ systemctl daemon-reload
|
|
|
5d2ee9 |
+ stopJournalctl
|
|
|
5d2ee9 |
+ grep "NUMA support not available, ignoring" "$journalLog"
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "systemd-run NUMAPolicy=default && NUMAMask=0 check without NUMA support"
|
|
|
5d2ee9 |
+ runUnit='numa-systemd-run-test.service'
|
|
|
5d2ee9 |
+ startJournalctl
|
|
|
5d2ee9 |
+ systemd-run -p NUMAPolicy=default -p NUMAMask=0 --unit $runUnit sleep 1000
|
|
|
5d2ee9 |
+ sleep $sleepAfterStart
|
|
|
5d2ee9 |
+ pid1StopUnit $runUnit
|
|
|
5d2ee9 |
+ stopJournalctl $runUnit
|
|
|
5d2ee9 |
+ grep "NUMA support not available, ignoring" "$journalLog"
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+else
|
|
|
5d2ee9 |
+ echo "PID1 NUMAPolicy support - Default policy w/o mask"
|
|
|
5d2ee9 |
+ writePID1NUMAPolicy "default"
|
|
|
5d2ee9 |
+ pid1ReloadWithStrace
|
|
|
5d2ee9 |
+ # Kernel requires that nodemask argument is set to NULL when setting default policy
|
|
|
5d2ee9 |
+ grep "set_mempolicy(MPOL_DEFAULT, NULL" $straceLog
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "PID1 NUMAPolicy support - Default policy w/ mask"
|
|
|
5d2ee9 |
+ writePID1NUMAPolicy "default" "0"
|
|
|
5d2ee9 |
+ pid1ReloadWithStrace
|
|
|
5d2ee9 |
+ grep "set_mempolicy(MPOL_DEFAULT, NULL" $straceLog
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "PID1 NUMAPolicy support - Bind policy w/o mask"
|
|
|
5d2ee9 |
+ writePID1NUMAPolicy "bind"
|
|
|
5d2ee9 |
+ pid1ReloadWithJournal
|
|
|
5d2ee9 |
+ grep "Failed to set NUMA memory policy: Invalid argument" $journalLog
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "PID1 NUMAPolicy support - Bind policy w/ mask"
|
|
|
5d2ee9 |
+ writePID1NUMAPolicy "bind" "0"
|
|
|
5d2ee9 |
+ pid1ReloadWithStrace
|
|
|
5d2ee9 |
+ grep -P "set_mempolicy\(MPOL_BIND, \[0x0*1\]" $straceLog
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "PID1 NUMAPolicy support - Interleave policy w/o mask"
|
|
|
5d2ee9 |
+ writePID1NUMAPolicy "interleave"
|
|
|
5d2ee9 |
+ pid1ReloadWithJournal
|
|
|
5d2ee9 |
+ grep "Failed to set NUMA memory policy: Invalid argument" $journalLog
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "PID1 NUMAPolicy support - Interleave policy w/ mask"
|
|
|
5d2ee9 |
+ writePID1NUMAPolicy "interleave" "0"
|
|
|
5d2ee9 |
+ pid1ReloadWithStrace
|
|
|
5d2ee9 |
+ grep -P "set_mempolicy\(MPOL_INTERLEAVE, \[0x0*1\]" $straceLog
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "PID1 NUMAPolicy support - Preferred policy w/o mask"
|
|
|
5d2ee9 |
+ writePID1NUMAPolicy "preferred"
|
|
|
5d2ee9 |
+ pid1ReloadWithJournal
|
|
|
5d2ee9 |
+ # Preferred policy with empty node mask is actually allowed and should reset allocation policy to default
|
|
|
5d2ee9 |
+ ! grep "Failed to set NUMA memory policy: Invalid argument" $journalLog
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "PID1 NUMAPolicy support - Preferred policy w/ mask"
|
|
|
5d2ee9 |
+ writePID1NUMAPolicy "preferred" "0"
|
|
|
5d2ee9 |
+ pid1ReloadWithStrace
|
|
|
5d2ee9 |
+ grep -P "set_mempolicy\(MPOL_PREFERRED, \[0x0*1\]" $straceLog
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "PID1 NUMAPolicy support - Local policy w/o mask"
|
|
|
5d2ee9 |
+ writePID1NUMAPolicy "local"
|
|
|
5d2ee9 |
+ pid1ReloadWithStrace
|
|
|
5d2ee9 |
+ # Kernel requires that nodemask argument is set to NULL when setting default policy
|
|
|
5d2ee9 |
+ # The unpatched versions of strace don't recognize the MPOL_LOCAL constant and
|
|
|
5d2ee9 |
+ # return a numerical constant instead (with a comment):
|
|
|
5d2ee9 |
+ # set_mempolicy(0x4 /* MPOL_??? */, NULL, 0) = 0
|
|
|
5d2ee9 |
+ # Let's cover this scenario as well
|
|
|
5d2ee9 |
+ grep -E "set_mempolicy\((MPOL_LOCAL|0x4 [^,]*), NULL" $straceLog
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "PID1 NUMAPolicy support - Local policy w/ mask"
|
|
|
5d2ee9 |
+ writePID1NUMAPolicy "local" "0"
|
|
|
5d2ee9 |
+ pid1ReloadWithStrace
|
|
|
5d2ee9 |
+ grep -E "set_mempolicy\((MPOL_LOCAL|0x4 [^,]*), NULL" $straceLog
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "Unit file NUMAPolicy support - Default policy w/o mask"
|
|
|
5d2ee9 |
+ writeTestUnitNUMAPolicy "default"
|
|
|
5d2ee9 |
+ pid1StartUnitWithStrace $testUnit
|
|
|
5d2ee9 |
+ systemctlCheckNUMAProperties $testUnit "default"
|
|
|
5d2ee9 |
+ pid1StopUnit $testUnit
|
|
|
5d2ee9 |
+ grep "set_mempolicy(MPOL_DEFAULT, NULL" $straceLog
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "Unit file NUMAPolicy support - Default policy w/ mask"
|
|
|
5d2ee9 |
+ writeTestUnitNUMAPolicy "default" "0"
|
|
|
5d2ee9 |
+ pid1StartUnitWithStrace $testUnit
|
|
|
5d2ee9 |
+ systemctlCheckNUMAProperties $testUnit "default" "0"
|
|
|
5d2ee9 |
+ pid1StopUnit $testUnit
|
|
|
5d2ee9 |
+ # Maks must be ignored
|
|
|
5d2ee9 |
+ grep "set_mempolicy(MPOL_DEFAULT, NULL" $straceLog
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "Unit file NUMAPolicy support - Bind policy w/o mask"
|
|
|
5d2ee9 |
+ writeTestUnitNUMAPolicy "bind"
|
|
|
5d2ee9 |
+ pid1StartUnitWithJournal $testUnit
|
|
|
5d2ee9 |
+ pid1StopUnit $testUnit
|
|
|
5d2ee9 |
+ grep "numa-test.service: Main process exited, code=exited, status=242/NUMA" $journalLog
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "Unit file NUMAPolicy support - Bind policy w/ mask"
|
|
|
5d2ee9 |
+ writeTestUnitNUMAPolicy "bind" "0"
|
|
|
5d2ee9 |
+ pid1StartUnitWithStrace $testUnit
|
|
|
5d2ee9 |
+ systemctlCheckNUMAProperties $testUnit "bind" "0"
|
|
|
5d2ee9 |
+ pid1StopUnit $testUnit
|
|
|
5d2ee9 |
+ grep -P "set_mempolicy\(MPOL_BIND, \[0x0*1\]" $straceLog
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "Unit file NUMAPolicy support - Interleave policy w/o mask"
|
|
|
5d2ee9 |
+ writeTestUnitNUMAPolicy "interleave"
|
|
|
5d2ee9 |
+ pid1StartUnitWithStrace $testUnit
|
|
|
5d2ee9 |
+ pid1StopUnit $testUnit
|
|
|
5d2ee9 |
+ grep "numa-test.service: Main process exited, code=exited, status=242/NUMA" $journalLog
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "Unit file NUMAPolicy support - Interleave policy w/ mask"
|
|
|
5d2ee9 |
+ writeTestUnitNUMAPolicy "interleave" "0"
|
|
|
5d2ee9 |
+ pid1StartUnitWithStrace $testUnit
|
|
|
5d2ee9 |
+ systemctlCheckNUMAProperties $testUnit "interleave" "0"
|
|
|
5d2ee9 |
+ pid1StopUnit $testUnit
|
|
|
5d2ee9 |
+ grep -P "set_mempolicy\(MPOL_INTERLEAVE, \[0x0*1\]" $straceLog
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "Unit file NUMAPolicy support - Preferred policy w/o mask"
|
|
|
5d2ee9 |
+ writeTestUnitNUMAPolicy "preferred"
|
|
|
5d2ee9 |
+ pid1StartUnitWithJournal $testUnit
|
|
|
5d2ee9 |
+ systemctlCheckNUMAProperties $testUnit "preferred"
|
|
|
5d2ee9 |
+ pid1StopUnit $testUnit
|
|
|
5d2ee9 |
+ ! grep "numa-test.service: Main process exited, code=exited, status=242/NUMA" $journalLog
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "Unit file NUMAPolicy support - Preferred policy w/ mask"
|
|
|
5d2ee9 |
+ writeTestUnitNUMAPolicy "preferred" "0"
|
|
|
5d2ee9 |
+ pid1StartUnitWithStrace $testUnit
|
|
|
5d2ee9 |
+ systemctlCheckNUMAProperties $testUnit "preferred" "0"
|
|
|
5d2ee9 |
+ pid1StopUnit $testUnit
|
|
|
5d2ee9 |
+ grep -P "set_mempolicy\(MPOL_PREFERRED, \[0x0*1\]" $straceLog
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "Unit file NUMAPolicy support - Local policy w/o mask"
|
|
|
5d2ee9 |
+ writeTestUnitNUMAPolicy "local"
|
|
|
5d2ee9 |
+ pid1StartUnitWithStrace $testUnit
|
|
|
5d2ee9 |
+ systemctlCheckNUMAProperties $testUnit "local"
|
|
|
5d2ee9 |
+ pid1StopUnit $testUnit
|
|
|
5d2ee9 |
+ grep -E "set_mempolicy\((MPOL_LOCAL|0x4 [^,]*), NULL" $straceLog
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "Unit file NUMAPolicy support - Local policy w/ mask"
|
|
|
5d2ee9 |
+ writeTestUnitNUMAPolicy "local" "0"
|
|
|
5d2ee9 |
+ pid1StartUnitWithStrace $testUnit
|
|
|
5d2ee9 |
+ systemctlCheckNUMAProperties $testUnit "local" "0"
|
|
|
5d2ee9 |
+ pid1StopUnit $testUnit
|
|
|
5d2ee9 |
+ # Maks must be ignored
|
|
|
5d2ee9 |
+ grep -E "set_mempolicy\((MPOL_LOCAL|0x4 [^,]*), NULL" $straceLog
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ echo "systemd-run NUMAPolicy support"
|
|
|
5d2ee9 |
+ runUnit='numa-systemd-run-test.service'
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ systemd-run -p NUMAPolicy=default --unit $runUnit sleep 1000
|
|
|
5d2ee9 |
+ systemctlCheckNUMAProperties $runUnit "default"
|
|
|
5d2ee9 |
+ pid1StopUnit $runUnit
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ systemd-run -p NUMAPolicy=default -p NUMAMask=0 --unit $runUnit sleep 1000
|
|
|
5d2ee9 |
+ systemctlCheckNUMAProperties $runUnit "default" ""
|
|
|
5d2ee9 |
+ pid1StopUnit $runUnit
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ systemd-run -p NUMAPolicy=bind -p NUMAMask=0 --unit $runUnit sleep 1000
|
|
|
5d2ee9 |
+ systemctlCheckNUMAProperties $runUnit "bind" "0"
|
|
|
5d2ee9 |
+ pid1StopUnit $runUnit
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ systemd-run -p NUMAPolicy=interleave -p NUMAMask=0 --unit $runUnit sleep 1000
|
|
|
5d2ee9 |
+ systemctlCheckNUMAProperties $runUnit "interleave" "0"
|
|
|
5d2ee9 |
+ pid1StopUnit $runUnit
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ systemd-run -p NUMAPolicy=preferred -p NUMAMask=0 --unit $runUnit sleep 1000
|
|
|
5d2ee9 |
+ systemctlCheckNUMAProperties $runUnit "preferred" "0"
|
|
|
5d2ee9 |
+ pid1StopUnit $runUnit
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ systemd-run -p NUMAPolicy=local --unit $runUnit sleep 1000
|
|
|
5d2ee9 |
+ systemctlCheckNUMAProperties $runUnit "local"
|
|
|
5d2ee9 |
+ pid1StopUnit $runUnit
|
|
|
5d2ee9 |
+
|
|
|
5d2ee9 |
+ systemd-run -p NUMAPolicy=local -p NUMAMask=0 --unit $runUnit sleep 1000
|
|
|
5d2ee9 |
+ systemctlCheckNUMAProperties $runUnit "local" ""
|
|
|
5d2ee9 |
+ pid1StopUnit $runUnit
|
|
|
5d2ee9 |
+fi
|
|
|
5d2ee9 |
|
|
|
5d2ee9 |
# Cleanup
|
|
|
5d2ee9 |
rm -rf $testDir
|
|
|
5d2ee9 |
--
|
|
|
5d2ee9 |
2.21.1
|
|
|
5d2ee9 |
|