lib/bdev: batch queued bdev reset completions.

Previously, when additional resets were submitted while a reset was in
progress, those resets were queued and then executed serially as part of
executing the original reset. Doing multiple resets on a bdev in quick
succession is not useful if the first reset succeeds and is very
unlikely to be useful in the negative case. Instead, we should batch
resets and complete them all at once when the current reset succeeds or
fails.

Change-Id: If10e0f37526860eaeeb41a8803d6298a3eff3212
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474599
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
This commit is contained in:
Seth Howell 2019-11-15 09:18:03 -07:00 committed by Tomasz Zawadzki
parent 61537a190e
commit b9af5dd834

View File

@ -3851,12 +3851,16 @@ bdev_reset_complete(struct spdk_io_channel_iter *i, int status)
static void
bdev_unfreeze_channel(struct spdk_io_channel_iter *i)
{
struct spdk_bdev_io *bdev_io = spdk_io_channel_iter_get_ctx(i);
struct spdk_io_channel *_ch = spdk_io_channel_iter_get_channel(i);
struct spdk_bdev_channel *ch = spdk_io_channel_get_ctx(_ch);
struct spdk_bdev_io *queued_reset;
ch->flags &= ~BDEV_CH_RESET_IN_PROGRESS;
if (!TAILQ_EMPTY(&ch->queued_resets)) {
bdev_channel_start_reset(ch);
while (!TAILQ_EMPTY(&ch->queued_resets)) {
queued_reset = TAILQ_FIRST(&ch->queued_resets);
TAILQ_REMOVE(&ch->queued_resets, queued_reset, internal.link);
spdk_bdev_io_complete(queued_reset, bdev_io->internal.status);
}
spdk_for_each_channel_continue(i, 0);