nvme/overhead: remove extra spdk_get_ticks()
The check_io function always calls spdk_get_ticks() - so return that value to the work_fn for checking when the test is complete, rather than have work_fn call spdk_get_ticks() again. This eliminates an extra rdtsc call that counts against the completion path. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I5a4f52eb2bec70a119c9ea7368bc7f2e8f17155c Reviewed-on: https://review.gerrithub.io/413152 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
58bcd554b5
commit
cf6ee25359
@ -334,7 +334,7 @@ io_complete(void *ctx, const struct spdk_nvme_cpl *completion)
|
|||||||
|
|
||||||
uint64_t g_complete_tsc_start;
|
uint64_t g_complete_tsc_start;
|
||||||
|
|
||||||
static void
|
static uint64_t
|
||||||
check_io(void)
|
check_io(void)
|
||||||
{
|
{
|
||||||
uint64_t end, tsc_complete;
|
uint64_t end, tsc_complete;
|
||||||
@ -378,8 +378,10 @@ check_io(void)
|
|||||||
if (!g_ns->is_draining) {
|
if (!g_ns->is_draining) {
|
||||||
submit_single_io();
|
submit_single_io();
|
||||||
}
|
}
|
||||||
g_complete_tsc_start = spdk_get_ticks();
|
end = g_complete_tsc_start = spdk_get_ticks();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return end;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -438,7 +440,7 @@ cleanup_ns_worker_ctx(void)
|
|||||||
static int
|
static int
|
||||||
work_fn(void)
|
work_fn(void)
|
||||||
{
|
{
|
||||||
uint64_t tsc_end;
|
uint64_t tsc_end, current;
|
||||||
|
|
||||||
/* Allocate a queue pair for each namespace. */
|
/* Allocate a queue pair for each namespace. */
|
||||||
if (init_ns_worker_ctx() != 0) {
|
if (init_ns_worker_ctx() != 0) {
|
||||||
@ -458,9 +460,9 @@ work_fn(void)
|
|||||||
* I/O will be submitted in the io_complete callback
|
* I/O will be submitted in the io_complete callback
|
||||||
* to replace each I/O that is completed.
|
* to replace each I/O that is completed.
|
||||||
*/
|
*/
|
||||||
check_io();
|
current = check_io();
|
||||||
|
|
||||||
if (spdk_get_ticks() > tsc_end) {
|
if (current > tsc_end) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user