diff --git a/scripts/ci/run-ci-tests.sh b/scripts/ci/run-ci-tests.sh index 262326047..65996e3ff 100755 --- a/scripts/ci/run-ci-tests.sh +++ b/scripts/ci/run-ci-tests.sh @@ -349,6 +349,15 @@ run_non_shardable_tests() { echo "Skipping memory compression ZDTM tests" fi + # Run a small checksum-verified compression benchmark. The full benchmark + # remains available under contrib/compression-benchmark for performance + # runs; this CI wrapper avoids dropping the host page cache. + if criu/criu check --feature compress; then + make -C test/others/compression/benchmark run + else + echo "Skipping compression benchmark test" + fi + if criu/criu check --feature compress; then # Hugetlb mappings are not premapped. Their blocks must remain # self-contained raw/zero fallbacks for PIE restore. diff --git a/test/others/compression/benchmark/Makefile b/test/others/compression/benchmark/Makefile index c27c9256b..c753f06d7 100644 --- a/test/others/compression/benchmark/Makefile +++ b/test/others/compression/benchmark/Makefile @@ -1,3 +1,6 @@ unit: python3 ./test_config.py -.PHONY: unit + +run: unit + ./run.sh +.PHONY: run unit diff --git a/test/others/compression/benchmark/run.sh b/test/others/compression/benchmark/run.sh new file mode 100755 index 000000000..fbe8be265 --- /dev/null +++ b/test/others/compression/benchmark/run.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +set -eu + +root=$(cd -- "$(dirname -- "$0")/../../../.." && pwd) + +if [ "$(id -u)" -ne 0 ]; then + echo "compression/benchmark: must run as root" >&2 + exit 1 +fi + +# main.py reads CRIU's generated statistics protobufs through pycriu. +make -C "$root" lib + +timeout --foreground --kill-after=30s 300s \ + python3 "$root/contrib/compression-benchmark/main.py" \ + --criu "$root/criu/criu" \ + --iterations 1 \ + --size 256 \ + --data-pattern zero mixed random text elf \ + --modes uncompressed lz4-page lz4-region \ + --region-sizes 65536 \ + --decompress-threads 4 \ + --no-drop-caches \ + --no-progress-bar