selftests: ublk: kublk: lift queue initialization out of thread
authorUday Shankar <ushankar@purestorage.com>
Thu, 29 May 2025 23:47:13 +0000 (17:47 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 30 May 2025 13:06:51 +0000 (07:06 -0600)
commit83f5c5d62905353a1be597c62d82b0ad14f23a7f
tree768a4bbf6040106b29cc1853641db2383a50e27b
parentc306e71dba79624cee2eb5a80bc5013b47943241
selftests: ublk: kublk: lift queue initialization out of thread

Currently, each ublk server I/O handler thread initializes its own
queue. However, as we move towards decoupled ublk_queues and ublk server
threads, this model does not make sense anymore, as there will no longer
be a concept of a thread having "its own" queue. So lift queue
initialization out of the per-thread ublk_io_handler_fn and into a loop
in ublk_start_daemon (which runs once for each device).

There is a part of ublk_queue_init (ring initialization) which does
actually need to happen on the thread that will use the ring; that is
separated into a separate ublk_thread_init which is still called by each
I/O handler thread.

Signed-off-by: Uday Shankar <ushankar@purestorage.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250529-ublk_task_per_io-v8-4-e9d3b119336a@purestorage.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
tools/testing/selftests/ublk/kublk.c