From c6e50f7f414d62a10b2d30006d04c083644fff5f Mon Sep 17 00:00:00 2001 From: Jin Yu Date: Thu, 28 Nov 2019 03:05:37 +0800 Subject: [PATCH] bdev: record the submit time The reset cmd and parent of splited IO would not go into the _bdev_io_submit() so they don't record the submitted time. The timeout IO check needs the submitted time so we add them in this patch. Change-Id: Ic7217171ec878d4a6dfa80d6635957ca0186928b Signed-off-by: Jin Yu Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476050 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Jim Harris --- lib/bdev/bdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/bdev/bdev.c b/lib/bdev/bdev.c index b4fb3b79c..1ca0229aa 100644 --- a/lib/bdev/bdev.c +++ b/lib/bdev/bdev.c @@ -1885,6 +1885,7 @@ bdev_io_submit(struct spdk_bdev_io *bdev_io) } if (bdev->split_on_optimal_io_boundary && bdev_io_should_split(bdev_io)) { + bdev_io->internal.submit_tsc = spdk_get_ticks(); bdev_io_split(NULL, bdev_io); return; } @@ -3495,6 +3496,7 @@ spdk_bdev_reset(struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, bdev_io->internal.ch = channel; bdev_io->internal.desc = desc; + bdev_io->internal.submit_tsc = spdk_get_ticks(); bdev_io->type = SPDK_BDEV_IO_TYPE_RESET; bdev_io->u.reset.ch_ref = NULL; bdev_io_init(bdev_io, bdev, cb_arg, cb);