performance-metrics: Add AIO completion drain micro benchmark

Add micro_block_raw_aio_drain_128_us and
micro_block_raw_aio_drain_256_us tests that submit N AIO writes
to a temporary file, wait for the eventfd signal, then time how
long it takes to drain all completions via next_completed_request().

This measures per completion syscall overhead and provides a
baseline before any batching optimizations.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
Anatol Belski
2026-03-14 15:28:29 +01:00
committed by Bo Chen
parent be6f63a740
commit 00957fa9db
4 changed files with 87 additions and 1 deletions

View File

@@ -4,6 +4,7 @@
//
// Custom harness to run performance tests
mod micro_bench_block;
mod performance_tests;
mod util;
@@ -336,6 +337,10 @@ mod adjuster {
v * 1000.0
}
pub fn s_to_us(v: f64) -> f64 {
v * 1_000_000.0
}
pub fn bps_to_gbps(v: f64) -> f64 {
v / (1_000_000_000_f64)
}
@@ -346,7 +351,7 @@ mod adjuster {
}
}
const TEST_LIST: [PerformanceTest; 60] = [
const TEST_LIST: [PerformanceTest; 62] = [
PerformanceTest {
name: "boot_time_ms",
func_ptr: performance_boot_time,
@@ -1197,6 +1202,30 @@ const TEST_LIST: [PerformanceTest; 60] = [
},
unit_adjuster: adjuster::Bps_to_MiBps,
},
PerformanceTest {
name: "micro_block_raw_aio_drain_128_us",
func_ptr: micro_bench_block::micro_bench_aio_drain,
control: PerformanceTestControl {
test_timeout: 5,
test_iterations: 20,
warmup_iterations: 5,
num_ops: Some(128),
..PerformanceTestControl::default()
},
unit_adjuster: adjuster::s_to_us,
},
PerformanceTest {
name: "micro_block_raw_aio_drain_256_us",
func_ptr: micro_bench_block::micro_bench_aio_drain,
control: PerformanceTestControl {
test_timeout: 5,
test_iterations: 20,
warmup_iterations: 5,
num_ops: Some(256),
..PerformanceTestControl::default()
},
unit_adjuster: adjuster::s_to_us,
},
];
fn run_test_with_timeout(