On Fri, Jun 20, 2025 at 09:10:05AM -0600, Caleb Sander Mateos wrote: > ublk_register_io_buf() performs an expensive atomic refcount increment, > as well as a lot of pointer chasing to look up the struct request. > > Create a separate ublk_daemon_register_io_buf() for the daemon task to > call. Initialize ublk_io's reference count to a large number, introduce > a field task_registered_buffers to count the buffers registered on the > daemon task, and atomically subtract the large number minus > task_registered_buffers in ublk_commit_and_fetch(). > > Also obtain the struct request directly from ublk_io's req field instead > of looking it up on the tagset. > > Signed-off-by: Caleb Sander Mateos <csander@xxxxxxxxxxxxxxx> Reviewed-by: Ming Lei <ming.lei@xxxxxxxxxx> Thanks, Ming