[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <176978595418.809940.7908857788281671989.b4-ty@kernel.dk>
Date: Fri, 30 Jan 2026 08:12:34 -0700
From: Jens Axboe <axboe@...nel.dk>
To: Ming Lei <ming.lei@...hat.com>,
Caleb Sander Mateos <csander@...estorage.com>
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ublk: restore auto buf unregister refcount
optimization
On Wed, 28 Jan 2026 13:56:34 -0700, Caleb Sander Mateos wrote:
> Commit 1ceeedb59749 ("ublk: optimize UBLK_IO_UNREGISTER_IO_BUF on daemon
> task") optimized ublk request buffer unregistration to use a non-atomic
> reference count decrement when performed on the ublk_io's daemon task.
> The optimization applied to auto buffer unregistration, which happens as
> part of handling UBLK_IO_COMMIT_AND_FETCH_REQ on the daemon task.
> However, commit b749965edda8 ("ublk: remove ublk_commit_and_fetch()")
> reordered the ublk_sub_req_ref() for the completed request before the
> io_buffer_unregister_bvec() call. As a result, task_registered_buffers
> is already 0 when io_buffer_unregister_bvec() calls ublk_io_release()
> and the non-atomic refcount optimization doesn't apply.
> Move the io_buffer_unregister_bvec() call back to before
> ublk_need_complete_req() to restore the reference counting optimization.
>
> [...]
Applied, thanks!
[1/1] ublk: restore auto buf unregister refcount optimization
commit: ad5f2e2908c9b79a86529281a48e94d644d43dc7
Best regards,
--
Jens Axboe
Powered by blists - more mailing lists