From 9ee64caa00e205e83c3385b407afb44c21ef2b73 Mon Sep 17 00:00:00 2001 From: Zach Koopmans Date: Fri, 18 Aug 2023 12:13:30 -0700 Subject: [PATCH] Rearrange fio tests cases so regexs aren't ridiculous. Rearrange benchmark function so calls in buildkite pipelines are correct without 100 charecter regexes. PiperOrigin-RevId: 558213872 --- .buildkite/pipeline.yaml | 16 ++-- test/benchmarks/fs/fio_test.go | 142 +++++++++++++++++++-------------- 2 files changed, 92 insertions(+), 66 deletions(-) diff --git a/.buildkite/pipeline.yaml b/.buildkite/pipeline.yaml index a83a3a699..eba5f18b8 100644 --- a/.buildkite/pipeline.yaml +++ b/.buildkite/pipeline.yaml @@ -562,18 +562,18 @@ steps: # but for tmpfs mounts, the size can grow to more memory than the machine # has available. Fix the runs to 1GB written/read for the benchmark. - <<: *benchmarks - label: ":floppy_disk: FIO benchmarks (read/write :nest_with_eggs: buffered)" - command: make -i benchmark-platforms BENCHMARKS_SUITE=fio BENCHMARKS_TARGETS=test/benchmarks/fs:fio_test BENCHMARKS_FILTER='Fio/operation\.[rw][er]*/blockSize*/directIO\.false' BENCHMARKS_OPTIONS=--test.benchtime=1000x + label: ":floppy_disk: FIO benchmarks (write :nest_with_eggs:)" + command: make -i benchmark-platforms BENCHMARKS_SUITE=fio BENCHMARKS_TARGETS=test/benchmarks/fs:fio_test BENCHMARKS_FILTER='BenchmarkFioWrite' BENCHMARKS_OPTIONS=--test.benchtime=1000x # For rand(read|write) fio benchmarks, running 15s does not overwhelm the system for tmpfs mounts. - <<: *benchmarks - label: ":cd: FIO benchmarks (randread/randwrite :nest_with_eggs: buffered)" - command: make -i benchmark-platforms BENCHMARKS_SUITE=fio BENCHMARKS_TARGETS=test/benchmarks/fs:fio_test BENCHMARKS_FILTER='Fio/operation\.rand*/blockSize*/directIO\.false' BENCHMARKS_OPTIONS=--test.benchtime=1000x + label: ":cd: FIO benchmarks (read :nest_with_eggs:)" + command: make -i benchmark-platforms BENCHMARKS_SUITE=fio BENCHMARKS_TARGETS=test/benchmarks/fs:fio_test BENCHMARKS_FILTER='BenchmarkFioRead' BENCHMARKS_OPTIONS=--test.benchtime=1000x - <<: *benchmarks - label: ":floppy_disk: FIO benchmarks (read/write :empty_nest: O_DIRECT)" - command: make -i benchmark-platforms BENCHMARKS_SUITE=fio BENCHMARKS_TARGETS=test/benchmarks/fs:fio_test BENCHMARKS_FILTER='Fio/operation\.[rw][er]*/blockSize*/directIO\.true' BENCHMARKS_OPTIONS=--test.benchtime=1000x + label: ":floppy_disk: FIO benchmarks (randwrte :empty_nest:)" + command: make -i benchmark-platforms BENCHMARKS_SUITE=fio BENCHMARKS_TARGETS=test/benchmarks/fs:fio_test BENCHMARKS_FILTER='BenchmarkFioRandWrite' BENCHMARKS_OPTIONS=--test.benchtime=1000x - <<: *benchmarks - label: ":cd: FIO benchmarks (randread/randwrite :empty_nest: O_DIRECT)" - command: make -i benchmark-platforms BENCHMARKS_SUITE=fio BENCHMARKS_TARGETS=test/benchmarks/fs:fio_test BENCHMARKS_FILTER='Fio/operation\.rand*/blockSize*/directIO\.true' BENCHMARKS_OPTIONS=--test.benchtime=1000x + label: ":cd: FIO benchmarks (randread :empty_nest:)" + command: make -i benchmark-platforms BENCHMARKS_SUITE=fio BENCHMARKS_TARGETS=test/benchmarks/fs:fio_test BENCHMARKS_FILTER='BenchmarkFioRandRead' BENCHMARKS_OPTIONS=--test.benchtime=1000x - <<: *benchmarks label: ":cd: Ruby CI/CD benchmarks" command: make -i benchmark-platforms BENCHMARKS_SUITE=fio BENCHMARKS_TARGETS=test/benchmarks/fs:rubydev_test BENCHMARKS_OPTIONS=-test.benchtime=1ns diff --git a/test/benchmarks/fs/fio_test.go b/test/benchmarks/fs/fio_test.go index 71e1d0e44..d69b24f9d 100644 --- a/test/benchmarks/fs/fio_test.go +++ b/test/benchmarks/fs/fio_test.go @@ -27,10 +27,12 @@ import ( "gvisor.dev/gvisor/test/benchmarks/tools" ) -// BenchmarkFio runs fio on the runtime under test. There are 4 basic test +// Fio benchmarks run fio on the runtime under test. There are 4 basic test // cases each run on a tmpfs mount and a bind mount. Fio requires root so that // caches can be dropped. -func BenchmarkFio(b *testing.B) { + +// BenchmarkFioWrite runs write operation benchmark cases. +func BenchmarkFioWrite(b *testing.B) { testCases := []tools.Fio{ { Test: "write", @@ -50,6 +52,37 @@ func BenchmarkFio(b *testing.B) { BlockSizeKB: 1024, IODepth: 4, }, + { + Test: "write", + IOEngine: tools.EngineLibAIO, + Jobs: 8, + BlockSizeKB: 4, + IODepth: 4, + Direct: true, + }, + { + Test: "write", + IOEngine: tools.EngineLibAIO, + Jobs: 8, + BlockSizeKB: 64, + IODepth: 4, + Direct: true, + }, + { + Test: "write", + IOEngine: tools.EngineLibAIO, + Jobs: 8, + BlockSizeKB: 1024, + IODepth: 4, + Direct: true, + }, + } + doFioBenchmark(b, testCases) +} + +// BenchmarkFioRead runs read operation test cases. +func BenchmarkFioRead(b *testing.B) { + testCases := []tools.Fio{ { Test: "read", IOEngine: tools.EngineLibAIO, @@ -68,74 +101,64 @@ func BenchmarkFio(b *testing.B) { BlockSizeKB: 1024, IODepth: 4, }, + { + Test: "read", + IOEngine: tools.EngineLibAIO, + Jobs: 8, + BlockSizeKB: 4, + IODepth: 4, + Direct: true, + }, + { + Test: "read", + IOEngine: tools.EngineLibAIO, + Jobs: 8, + BlockSizeKB: 64, + IODepth: 4, + Direct: true, + }, + { + Test: "read", + IOEngine: tools.EngineLibAIO, + Jobs: 8, + BlockSizeKB: 1024, + IODepth: 4, + Direct: true, + }, + } + doFioBenchmark(b, testCases) +} + +// BenchmarkFioRandWrite runs randwrite test cases. +func BenchmarkFioRandWrite(b *testing.B) { + testCases := []tools.Fio{ { Test: "randwrite", IOEngine: tools.EngineLibAIO, BlockSizeKB: 4, IODepth: 4, }, + { + Test: "randwrite", + IOEngine: tools.EngineLibAIO, + Jobs: 8, + BlockSizeKB: 4, + IODepth: 4, + Direct: true, + }, + } + doFioBenchmark(b, testCases) +} + +// BenchmarkFioRandRead runs randread test cases. +func BenchmarkFioRandRead(b *testing.B) { + testCases := []tools.Fio{ { Test: "randread", IOEngine: tools.EngineLibAIO, BlockSizeKB: 4, IODepth: 4, }, - { - Test: "write", - IOEngine: tools.EngineLibAIO, - Jobs: 8, - BlockSizeKB: 4, - IODepth: 4, - Direct: true, - }, - { - Test: "write", - IOEngine: tools.EngineLibAIO, - Jobs: 8, - BlockSizeKB: 64, - IODepth: 4, - Direct: true, - }, - { - Test: "write", - IOEngine: tools.EngineLibAIO, - Jobs: 8, - BlockSizeKB: 1024, - IODepth: 4, - Direct: true, - }, - { - Test: "read", - IOEngine: tools.EngineLibAIO, - Jobs: 8, - BlockSizeKB: 4, - IODepth: 4, - Direct: true, - }, - { - Test: "read", - IOEngine: tools.EngineLibAIO, - Jobs: 8, - BlockSizeKB: 64, - IODepth: 4, - Direct: true, - }, - { - Test: "read", - IOEngine: tools.EngineLibAIO, - Jobs: 8, - BlockSizeKB: 1024, - IODepth: 4, - Direct: true, - }, - { - Test: "randwrite", - IOEngine: tools.EngineLibAIO, - Jobs: 8, - BlockSizeKB: 4, - IODepth: 4, - Direct: true, - }, { Test: "randread", IOEngine: tools.EngineLibAIO, @@ -145,7 +168,10 @@ func BenchmarkFio(b *testing.B) { Direct: true, }, } + doFioBenchmark(b, testCases) +} +func doFioBenchmark(b *testing.B, testCases []tools.Fio) { machine, err := harness.GetMachine() if err != nil { b.Fatalf("failed to get machine with: %v", err)