Skip to content

Commit 6492537

Browse files
committed
Perftest: Fix BW degradation with --output flag due to CPU starvation
When using '--output=bandwidth', skipping print headers causes the test to enter the polling loop immediately, starving the CPU core handling NIC interrupts. This leads to significant performance drops (e.g., ~50%) on local socket cores. Add a usleep(1) to yield the CPU before starting measurement, allowing interrupts to be processed correctly. Signed-off-by: Shmuel Shaul <sshaul@nvidia.com>
1 parent 1c4dc79 commit 6492537

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/perftest_parameters.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4039,8 +4039,10 @@ void ctx_print_test_info(struct perftest_parameters *user_param)
40394039
{
40404040
int temp = 0;
40414041

4042-
if (user_param->output != FULL_VERBOSITY)
4042+
if (user_param->output != FULL_VERBOSITY){
4043+
usleep(1); /* Yield CPU to prevent interrupt starvation on the local socket before the test starts */
40434044
return;
4045+
}
40444046

40454047
printf(RESULT_LINE);
40464048
printf(" ");

0 commit comments

Comments
 (0)