* [PATCH] tools/virtio/virtio_test: advance next_reset by reset_n, not completed
@ 2026-11-05 7:47 Gu Bin
2026-11-05 7:51 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Gu Bin @ 2026-11-05 7:47 UTC (permalink / raw)
To: mst; +Cc: jasowangio, eperezma, xuanzhuo, virtualization, linux-kernel
run_test() arms the next device reset with
while (completed > next_reset)
next_reset += completed;
next_reset starts at reset_n, but each rearm advances the threshold by
the absolute completion count instead of the configured interval, so
the reset cadence stretches after every reset: with reset_n == 16 the
resets fire at completions 17, 34, 68, 136, ... instead of every 16
completions, and only a handful of resets happen over the whole run.
Advance next_reset by reset_n so resets stay evenly spaced, matching
the --reset=<n> option meaning.
Fixes: 264ee5aa81ec ("tools/virtio: Add --reset")
Signed-off-by: Gu Bin <gubin@cmss.chinamobile.com>
---
tools/virtio/virtio_test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c
index 028f54e6854a..b8deca893f12 100644
--- a/tools/virtio/virtio_test.c
+++ b/tools/virtio/virtio_test.c
@@ -250,7 +250,7 @@ static void run_test(struct vdev_info *dev, struct vq_info *vq,
started = completed;
while (completed > next_reset)
- next_reset += completed;
+ next_reset += reset_n;
}
} while (r == 0);
if (completed == completed_before && started == started_before)
--
2.55.0.windows.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] tools/virtio/virtio_test: advance next_reset by reset_n, not completed
2026-11-05 7:47 [PATCH] tools/virtio/virtio_test: advance next_reset by reset_n, not completed Gu Bin
@ 2026-11-05 7:51 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-05 7:51 UTC (permalink / raw)
To: Gu Bin; +Cc: virtualization, Michael S. Tsirkin, Eugenio Perez
> run_test() arms the next device reset with
>
> while (completed > next_reset)
> next_reset += completed;
>
> next_reset starts at reset_n, but each rearm advances the threshold by
> the absolute completion count instead of the configured interval, so
> the reset cadence stretches after every reset: with reset_n == 16 the
> resets fire at completions 17, 34, 68, 136, ... instead of every 16
> completions, and only a handful of resets happen over the whole run.
>
> Advance next_reset by reset_n so resets stay evenly spaced, matching
> the --reset=<n> option meaning.
>
> Fixes: 264ee5aa81ec ("tools/virtio: Add --reset")
> Signed-off-by: Gu Bin <gubin@cmss.chinamobile.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261105074741.2177-1-gubin@cmss.chinamobile.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-05 7:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-05 7:47 [PATCH] tools/virtio/virtio_test: advance next_reset by reset_n, not completed Gu Bin
2026-11-05 7:51 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox