On Tue, May 27, 2025 at 05:01:29PM -0600, Uday Shankar wrote:
> Add support in kublk for decoupled ublk_queues and ublk server threads.
> kublk now has two modes of operation:
>
> - (preexisting mode) threads and queues are paired 1:1, and each thread
> services all the I/Os of one queue
> - (new mode) thread and queue counts are independently configurable.
> threads service I/Os in a way that balances load across threads even
> if load is not balanced over queues.
>
> The default is the preexisting mode. The new mode is activated by
> passing the --per_io_tasks flag.
>
> Signed-off-by: Uday Shankar <[email protected]>
> ---
...
> diff --git a/tools/testing/selftests/ublk/kublk.h
> b/tools/testing/selftests/ublk/kublk.h
> index
> 3a2ae095bee18633acd5a9c923cfab2d14fe3bff..4cc8103bc49a7a93bbf61986cde8f4e6e1be716d
> 100644
> --- a/tools/testing/selftests/ublk/kublk.h
> +++ b/tools/testing/selftests/ublk/kublk.h
> @@ -80,6 +80,7 @@ struct dev_ctx {
> char tgt_type[16];
> unsigned long flags;
> unsigned nr_hw_queues;
> + unsigned nthreads;
> unsigned queue_depth;
> int dev_id;
> int nr_files;
> @@ -89,6 +90,7 @@ struct dev_ctx {
> unsigned int fg:1;
> unsigned int recovery:1;
> unsigned int auto_zc_fallback:1;
> + unsigned int per_io_tasks:1;
>
> int _evtfd;
> int _shmid;
> @@ -128,6 +130,7 @@ struct ublk_io {
> unsigned short refs; /* used by target code only */
>
> int tag;
> + int buf_index;
Both the above two can be 'unsigned short', otherwise:
Reviewed-by: Ming Lei <[email protected]>