io_uring: set async IO priority to td->ioprio in fio_ioring_prep()
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)
commit8ff6b289751c0750b9dc2e3245c14db7461ef2a7
tree8683fc8dd74b1e1536c27df24769660aa5e1c161
parenta5af2a8b73faa9f28e676f754280dd177ac01f07
io_uring: set async IO priority to td->ioprio in fio_ioring_prep()

The default priority (which is either 0 or the value set by "prio" and
"prioclass" options) is now saved in td->ioprio.

The simplest thing is therefore to unconditionally set the async IO
priority to td->ioprio in fio_ioring_prep(), and let fio_ioring_prio_prep()
only handle the case where cmdprio_percentage/cmdprio_bssplit is enabled.

Therefore, fio_ioring_prio_prep() doesn't need to care if prio/prioclass
was enabled or not, we can simply think that fio_ioring_prio_prep()
might "override" the default priority, whatever the default priority may
be.

Doing it this way also has the advantage that the prio_prep() function
in io_uring will now look identical to the prio_prep() function in
libaio.

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-5-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/io_uring.c