diff options
author | Jens Axboe <axboe@kernel.dk> | 2020-07-27 16:00:20 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-07-27 16:00:20 -0600 |
commit | b5aba537d844f73187eb931179ac59e7da570e7c (patch) | |
tree | 35f9c2e078b5304d7842f6a77f4c913616dfce71 | |
parent | 6d975f2c8c3061b1d39c121d509d866890afd162 (diff) | |
download | fio-b5aba537d844f73187eb931179ac59e7da570e7c.tar.gz fio-b5aba537d844f73187eb931179ac59e7da570e7c.tar.bz2 |
iolog: ensure that dynamic log entries are at least queue depth sized
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | iolog.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -19,6 +19,7 @@ #include "smalloc.h" #include "blktrace.h" #include "pshared.h" +#include "lib/roundup.h" #include <netinet/in.h> #include <netinet/tcp.h> @@ -748,10 +749,13 @@ void setup_log(struct io_log **log, struct log_params *p, } if (l->td && l->td->o.io_submit_mode != IO_MODE_OFFLOAD) { + unsigned int def_samples = DEF_LOG_ENTRIES; struct io_logs *__p; __p = calloc(1, sizeof(*l->pending)); - __p->max_samples = DEF_LOG_ENTRIES; + if (l->td->o.iodepth > DEF_LOG_ENTRIES) + def_samples = roundup_pow2(l->td->o.iodepth); + __p->max_samples = def_samples; __p->log = calloc(__p->max_samples, log_entry_sz(l)); l->pending = __p; } |