This allows controlling how much IO we submit in one go
independent of the iodepth set.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
job, can be overridden with a larger value for higher
concurrency.
job, can be overridden with a larger value for higher
concurrency.
+iodepth_batch=int This defines how many pieces of IO to submit at once.
+ It defaults to the same as iodepth, but can be set lower
+ if one so desires.
+
iodepth_low=int The low water mark indicating when to start filling
the queue again. Defaults to the same as iodepth, meaning
that fio will attempt to keep the queue full at all times.
iodepth_low=int The low water mark indicating when to start filling
the queue again. Defaults to the same as iodepth, meaning
that fio will attempt to keep the queue full at all times.
*/
if (td->io_ops->commit == NULL)
io_u_queued(td, io_u);
*/
if (td->io_ops->commit == NULL)
io_u_queued(td, io_u);
+ else if (td->io_u_queued >= td->iodepth_batch)
+ ret = td_io_commit(td);
break;
case FIO_Q_BUSY:
requeue_io_u(td, &io_u);
break;
case FIO_Q_BUSY:
requeue_io_u(td, &io_u);
unsigned int numjobs;
unsigned int iodepth;
unsigned int iodepth_low;
unsigned int numjobs;
unsigned int iodepth;
unsigned int iodepth_low;
+ unsigned int iodepth_batch;
os_cpu_mask_t cpumask;
unsigned int iolog;
unsigned int read_iolog;
os_cpu_mask_t cpumask;
unsigned int iolog;
unsigned int read_iolog;
struct list_head io_u_freelist;
struct list_head io_u_busylist;
struct list_head io_u_requeues;
struct list_head io_u_freelist;
struct list_head io_u_busylist;
struct list_head io_u_requeues;
+ unsigned int io_u_queued;
.help = "Amount of IO buffers to keep in flight",
.def = "1",
},
.help = "Amount of IO buffers to keep in flight",
.def = "1",
},
+ {
+ .name = "iodepth_batch",
+ .type = FIO_OPT_INT,
+ .off1 = td_var_offset(iodepth_batch),
+ .help = "Number of IO to submit in one go",
+ },
{
.name = "iodepth_low",
.type = FIO_OPT_INT,
{
.name = "iodepth_low",
.type = FIO_OPT_INT,
*/
if (td->iodepth_low > td->iodepth || !td->iodepth_low)
td->iodepth_low = td->iodepth;
*/
if (td->iodepth_low > td->iodepth || !td->iodepth_low)
td->iodepth_low = td->iodepth;
+
+ /*
+ * If batch number isn't set, default to the same as iodepth
+ */
+ if (td->iodepth_batch > td->iodepth || !td->iodepth_batch)
+ td->iodepth_batch = td->iodepth;
ret = td->io_ops->queue(td, io_u);
ret = td->io_ops->queue(td, io_u);
+ if (ret == FIO_Q_QUEUED)
+ td->io_u_queued++;
+
if ((td->io_ops->flags & FIO_SYNCIO) == 0) {
fio_gettime(&io_u->issue_time, NULL);
if ((td->io_ops->flags & FIO_SYNCIO) == 0) {
fio_gettime(&io_u->issue_time, NULL);
{
if (!td->cur_depth)
return 0;
{
if (!td->cur_depth)
return 0;
if (td->io_ops->commit)
return td->io_ops->commit(td);
if (td->io_ops->commit)
return td->io_ops->commit(td);