Remove two global variables and use variables per target instead. g_min_alignment: Bdevperf creates task on a target after creating the target, and we has removed any limitation about alignment described in the comment. Remove g_min_alignment and use each bdev's alignment to call spdk_zmalloc() instead. g_buf_size: We had set the size of task->buf by not g_buf_size but g_io_size by mistake. We have not used any global buffer pool and can use buffer size per io_target instead. Delete g_buf_size and add buf_size to struct io_target. Then initialize target->buf_size in bdevperf_construct_target() and use it instead of g_buf_size including the fix in bdevperf_construct_task_on_target(). Besides, as a minor cleanup, remove duplicated initialization of global variables in this patch. Global variables are already initialized at their definition. Remove duplicated initialization from main() function. It is ensured that global variables are automatically zeroed but write initialized value expilcitly for compatibility and clarification. These will be helpful to parallelize targets and tasks management among multiple threads. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: Iba23dec3e1da8810da7523da09bae858eb4484a2 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/512 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> |
||
---|---|---|
.. | ||
.gitignore | ||
bdevperf.c | ||
bdevperf.py | ||
Makefile |