nvme/perf: add -m option to limit max completions

Change-Id: Idb607f2024f1640d2f4a92e310360e0fc9bba67d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2015-11-05 16:45:33 -07:00
parent afee86f9f8
commit 68ff76297b

View File

@ -131,6 +131,7 @@ static int g_rw_percentage;
static int g_is_random;
static int g_queue_depth;
static int g_time_in_sec;
static uint32_t g_max_completions;
static const char *g_core_mask;
@ -396,7 +397,7 @@ check_io(struct ns_worker_ctx *ns_ctx)
} else
#endif
{
nvme_ctrlr_process_io_completions(ns_ctx->entry->u.nvme.ctrlr, 0);
nvme_ctrlr_process_io_completions(ns_ctx->entry->u.nvme.ctrlr, g_max_completions);
}
}
@ -481,6 +482,8 @@ static void usage(char *program_name)
printf("\t[-t time in seconds]\n");
printf("\t[-c core mask for I/O submission/completion.]\n");
printf("\t\t(default: 1)]\n");
printf("\t[-m max completions per poll]\n");
printf("\t\t(default: 0 - unlimited)\n");
}
static void
@ -528,12 +531,16 @@ parse_args(int argc, char **argv)
g_time_in_sec = 0;
g_rw_percentage = -1;
g_core_mask = NULL;
g_max_completions = 0;
while ((op = getopt(argc, argv, "c:q:s:t:w:M:")) != -1) {
while ((op = getopt(argc, argv, "c:m:q:s:t:w:M:")) != -1) {
switch (op) {
case 'c':
g_core_mask = optarg;
break;
case 'm':
g_max_completions = atoi(optarg);
break;
case 'q':
g_queue_depth = atoi(optarg);
break;