nvmf: Add BDEV IO pending statistics

This patch adds statistics for BDEV IO pending state in NVMf subsytem
which may help to detect lack of resources and configure pool size
correctly.

Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Change-Id: I6c60c27efe3efed194b2d2c46a707af7c2808fe9
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/445290
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
Evgeniy Kochetov 2019-05-22 22:25:34 +03:00 committed by Ben Walker
parent da999b69b8
commit 9d5037275d
4 changed files with 7 additions and 3 deletions

View File

@ -4171,7 +4171,8 @@ Example response:
{
"name": "app_thread",
"admin_qpairs": 1,
"io_qpairs": 4
"io_qpairs": 4,
"pending_bdev_io": 1721
}
]
}

View File

@ -81,6 +81,7 @@ struct spdk_nvmf_transport_opts {
struct spdk_nvmf_poll_group_stat {
uint32_t admin_qpairs;
uint32_t io_qpairs;
uint64_t pending_bdev_io;
};
/**

View File

@ -1656,6 +1656,7 @@ rpc_nvmf_get_stats(struct spdk_io_channel_iter *i)
spdk_json_write_named_string(ctx->w, "name", spdk_thread_get_name(spdk_get_thread()));
spdk_json_write_named_uint32(ctx->w, "admin_qpairs", stat.admin_qpairs);
spdk_json_write_named_uint32(ctx->w, "io_qpairs", stat.io_qpairs);
spdk_json_write_named_uint64(ctx->w, "pending_bdev_io", stat.pending_bdev_io);
spdk_json_write_object_end(ctx->w);
}

View File

@ -1,8 +1,8 @@
/*-
* BSD LICENSE
*
* Copyright (c) Intel Corporation.
* All rights reserved.
* Copyright (c) Intel Corporation. All rights reserved.
* Copyright (c) 2019 Mellanox Technologies LTD. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -213,6 +213,7 @@ nvmf_bdev_ctrl_queue_io(struct spdk_nvmf_request *req, struct spdk_bdev *bdev,
if (rc != 0) {
assert(false);
}
req->qpair->group->stat.pending_bdev_io++;
}
int