Re: [PATCH 5/8] libaio,io_uring: rename prio_prep() to include cmdprio in the name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2021/11/09 9:28, Niklas Cassel wrote:
> From: Niklas Cassel <niklas.cassel@xxxxxxx>
> 
> 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@xxxxxxx>
> ---
>  engines/io_uring.c | 9 +++++----
>  engines/libaio.c   | 4 ++--
>  2 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/engines/io_uring.c b/engines/io_uring.c
> index 8f3d6c39..de1e6cc9 100644
> --- a/engines/io_uring.c
> +++ b/engines/io_uring.c
> @@ -346,8 +346,8 @@ static int fio_ioring_prep(struct thread_data *td, struct io_u *io_u)
>  		 * (option prio/prioclass) to be inherited.
>  		 * td->ioprio will have the value of the "default prio", so set
>  		 * this unconditionally. This value might get overriden by
> -		 * fio_ioring_prio_prep() if cmdprio_percentage/cmdprio_bssplit
> -		 * is enabled.
> +		 * fio_ioring_cmdprio_prep() if
> +		 * cmdprio_percentage/cmdprio_bssplit is enabled.
>  		 */
>  		sqe->ioprio = td->ioprio;
>  		sqe->off = io_u->offset;
> @@ -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);
>  
> diff --git a/engines/libaio.c b/engines/libaio.c
> index dd655355..9c14dd88 100644
> --- a/engines/libaio.c
> +++ b/engines/libaio.c
> @@ -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;
> 

Looks good.

Reviewed-by: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx>

-- 
Damien Le Moal
Western Digital Research



[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux