From e588338b4976f5e3fccb19b105e2e793ed118529 Mon Sep 17 00:00:00 2001 From: Semir Sionek Date: Fri, 9 May 2025 08:16:54 -0400 Subject: [PATCH] hsa: scale the data chunk threshold for echo client tput based on fifo size Type: improvement Change-Id: I37636f4d4c3949c36ead71e602754ccdb07b9c7a Signed-off-by: Semir Sionek --- src/plugins/hs_apps/echo_client.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/plugins/hs_apps/echo_client.c b/src/plugins/hs_apps/echo_client.c index 1c0e49c716b..54e806a9ba4 100644 --- a/src/plugins/hs_apps/echo_client.c +++ b/src/plugins/hs_apps/echo_client.c @@ -653,8 +653,19 @@ ec_calc_tput (ec_main_t *ecm) ec_session_t *sess; f64 pacing_base; u64 bytes_paced_target; - /* periodic writes larger than this clog up the fifo */ - const u64 target_size_threshold = 4344; + u64 target_size_threshold; + + /* Choose an appropriate data size chunk threshold based on fifo size. + ~30k is fine for most scenarios, unless the fifo starts getting + smaller than 48k, where a slight curve is needed. */ + if (PREDICT_TRUE (ecm->fifo_size > 49152)) + target_size_threshold = 30720; + else if (ecm->fifo_size > 20480) + target_size_threshold = 12288; + else if (ecm->fifo_size > 10240) + target_size_threshold = 6144; + else + target_size_threshold = ecm->fifo_size; /* find a suitable pacing window length & data chunk size */ bytes_paced_target = -- 2.16.6