From ecd5509969369ff43799bae0ea9ab5d7fa7c0af4 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Thu, 4 Aug 2022 19:06:17 +0000 Subject: [PATCH] venus: increase busy wait order in vn_relax This is mainly to workaround a platform issue that has huge sleep penalty, which could lead to a timeout if the small synchronous queries are going to sleep. This change adjusts the warn and abort order correspondingly so that to match prior timing. Signed-off-by: Yiwei Zhang Reviewed-by: Ryan Neph Part-of: --- src/virtio/vulkan/vn_common.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/virtio/vulkan/vn_common.c b/src/virtio/vulkan/vn_common.c index 9977160101d..887fefd9984 100644 --- a/src/virtio/vulkan/vn_common.c +++ b/src/virtio/vulkan/vn_common.c @@ -120,10 +120,10 @@ vn_relax(uint32_t *iter, const char *reason) * base_sleep_us microseconds for the same number of times. After that, * keep doubling both sleep length and count. */ - const uint32_t busy_wait_order = 4; + const uint32_t busy_wait_order = 8; const uint32_t base_sleep_us = vn_env.relax_base_sleep_us; - const uint32_t warn_order = 12; - const uint32_t abort_order = 14; + const uint32_t warn_order = 14; + const uint32_t abort_order = 16; (*iter)++; if (*iter < (1 << busy_wait_order)) { @@ -131,8 +131,8 @@ vn_relax(uint32_t *iter, const char *reason) return; } - /* warn occasionally if we have slept at least 1.28ms for 2048 times (plus - * another 2047 shorter sleeps) + /* warn occasionally if we have slept at least 0.32ms for 8192 times (plus + * another 8191 shorter sleeps) */ if (unlikely(*iter % (1 << warn_order) == 0)) { vn_log(NULL, "stuck in %s wait with iter at %d", reason, *iter);