Skip to contentSkip to conversation

kselftest/arm64: Add pidbench for floating point syscall cases

PATCH In review Mark Brown 2 participants 2 messages Dec 2, 2021 – Dec 14, 2021

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 kselftest/arm64: Add pidbench for floating point syscall cases

Since it's likely to be useful for performance work with SVE let's have a pidbench that gives us some numbers for consideration. In order to ensure that we test exactly the scenario we want this is written in assembly - if system libraries use SVE this would stop us exercising the case where the process has never used SVE.

We exercise three cases:

- Never having used SVE.
- Having used SVE once.
- Using SVE after each syscall.

by spinning running getpid() for a fixed number of iterations with the time measured using CNTVCT_EL0 reported on the console. This is obviously a totally unrealistic benchmark which will show the extremes of any performance variation but equally given the potential gotchas with use of FP instructions by system libraries it's good to have some concrete code shared to make it easier to compare notes on results.

Testing over multiple SVE vector lengths will need to be done with vlset currently, the test could be extended to iterate over all of them if desired.

---
 tools/testing/selftests/arm64/fp/.gitignore   |  1 +
 tools/testing/selftests/arm64/fp/Makefile     |  4 +-
 .../testing/selftests/arm64/fp/fp-pidbench.S  | 71 +++++++++++++++++++
 3 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/selftests/arm64/fp/fp-pidbench.S
tools/testing/selftests/arm64/fp/.gitignore +1 -0
index b67395903b9b..c50d86331ed2 100644
@@ -1,3 +1,4 @@
+fp-pidbench
 fpsimd-test
 rdvl-sve
 sve-probe-vls
tools/testing/selftests/arm64/fp/Makefile +3 -1
index ba1488c7c315..95f0b877a060 100644
@@ -2,13 +2,15 @@
 
 CFLAGS += -I../../../../../usr/include/
 TEST_GEN_PROGS := sve-ptrace sve-probe-vls vec-syscfg
-TEST_PROGS_EXTENDED := fpsimd-test fpsimd-stress \
+TEST_PROGS_EXTENDED := fp-pidbench fpsimd-test fpsimd-stress \
 	rdvl-sve \
 	sve-test sve-stress \
 	vlset
 
 all: $(TEST_GEN_PROGS) $(TEST_PROGS_EXTENDED)
 
+fp-pidbench: fp-pidbench.S asm-utils.o
+	$(CC) -nostdlib $^ -o $@
 fpsimd-test: fpsimd-test.o asm-utils.o
 	$(CC) -nostdlib $^ -o $@
 rdvl-sve: rdvl-sve.o rdvl.o
tools/testing/selftests/arm64/fp/fp-pidbench.S new file +71 -0

71 lines not on this page · raw message

Signature · 1 line
2.30.2
maintainer
#1 lore raw
Quoted 9 lines · Mark Brown

Since it's likely to be useful for performance work with SVE let's have a pidbench that gives us some numbers for consideration. In order to ensure that we test exactly the scenario we want this is written in assembly - if system libraries use SVE this would stop us exercising the case where the process has never used SVE.

We exercise three cases:

[...]

Applied to arm64 (for-next/kselftest), thanks!

[1/1] kselftest/arm64: Add pidbench for floating point syscall cases

      https://git.kernel.org/arm64/c/2c94ebedc844
Signature · 1 line
Catalin