libaio,io_uring: rename prio_prep() to include cmdprio in the name
authorNiklas Cassel <niklas.cassel@wdc.com>
Fri, 12 Nov 2021 09:54:41 +0000 (09:54 +0000)
committerJens Axboe <axboe@kernel.dk>
Fri, 12 Nov 2021 15:49:55 +0000 (08:49 -0700)
The default priority (which is either 0 or the value set by "prio" and
"prioclass" options, will now be used regardless if prio_prep() is
called or not. This is true for both libaio and io_uring.

The way to think about it is that prio_prep() is only called if
cmdprio_percentage/cmdprio_bssplit is used.

prio_prep() might then override the default priority, if the random
value happens to say that this I/O should use the cmdprio_value,
rather than the default priority.

Rename the prio_prep() functions to highlight that these functions
are now only called if cmdprio is used. (If only option
"prio"/"prioclass" is used, that is handled elsewhere.)

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20211112095428.158300-6-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/io_uring.c
engines/libaio.c

index 7a2b20ecc8e1812ff35262dd93ac38af293fae15..0568b8f7cba344e0c1bd9c6d14abe81a76e65fbc 100644 (file)
@@ -346,7 +346,7 @@ static int fio_ioring_prep(struct thread_data *td, struct io_u *io_u)
                 * to be inherited.
                 * td->ioprio will have the value of the "default prio", so set
                 * this unconditionally. This value might get overridden by
-                * fio_ioring_prio_prep() if the option cmdprio_percentage or
+                * fio_ioring_cmdprio_prep() if the option cmdprio_percentage or
                 * cmdprio_bssplit is used.
                 */
                sqe->ioprio = td->ioprio;
@@ -456,7 +456,7 @@ static int fio_ioring_getevents(struct thread_data *td, unsigned int min,
        return r < 0 ? r : events;
 }
 
-static void fio_ioring_prio_prep(struct thread_data *td, struct io_u *io_u)
+static void fio_ioring_cmdprio_prep(struct thread_data *td, struct io_u *io_u)
 {
        struct ioring_options *o = td->eo;
        struct ioring_data *ld = td->io_ops_data;
@@ -517,7 +517,8 @@ static enum fio_q_status fio_ioring_queue(struct thread_data *td,
                return FIO_Q_BUSY;
 
        if (ld->use_cmdprio)
-               fio_ioring_prio_prep(td, io_u);
+               fio_ioring_cmdprio_prep(td, io_u);
+
        ring->array[tail & ld->sq_ring_mask] = io_u->index;
        atomic_store_release(ring->tail, next_tail);
 
index dd655355ba6995725c82f27ec3264690d92c3709..9c14dd88d5d0b3609a0a417fbcfb9c6b9c40c90b 100644 (file)
@@ -205,7 +205,7 @@ static int fio_libaio_prep(struct thread_data *td, struct io_u *io_u)
        return 0;
 }
 
-static void fio_libaio_prio_prep(struct thread_data *td, struct io_u *io_u)
+static void fio_libaio_cmdprio_prep(struct thread_data *td, struct io_u *io_u)
 {
        struct libaio_options *o = td->eo;
        struct cmdprio *cmdprio = &o->cmdprio;
@@ -369,7 +369,7 @@ static enum fio_q_status fio_libaio_queue(struct thread_data *td,
        }
 
        if (ld->use_cmdprio)
-               fio_libaio_prio_prep(td, io_u);
+               fio_libaio_cmdprio_prep(td, io_u);
 
        ld->iocbs[ld->head] = &io_u->iocb;
        ld->io_us[ld->head] = io_u;