On Thu, Nov 19, 2026 at 06:05:08AM -0500, Qiliang Yuan wrote:
> thin_dtr() takes the thin off pool->active_thins once its last
> reference is dropped and then waits for a grace period, so that
> requeue_bios() and error_retry_list_with_code(), which walk the list
> under rcu_read_lock(), are done with the thin before it is freed.
> 
> Removing a thin device thus waits for a full grace period in thin_dtr(),
> although those readers only need the memory of the thin to stay around.
> 
> Free the thin with kfree_rcu() instead of waiting for the grace period.
> 
> Removing 100 thin devices of an idle pool with dmsetup remove takes per
> device (mean of five rounds, min-max of the rounds in parentheses). The
> queue freeze in del_gendisk() waits for a grace period of its own, which
> the one in thin_dtr() used to overlap, so only part of it is saved:
> 
>   before (ms)        after (ms)         change
>   17.2 (17.0-17.4)   13.7 (13.2-14.4)     -20%
> 
> Signed-off-by: Qiliang Yuan <[email protected]>
Reviewed-by: Benjamin Marzinski <[email protected]>


Reply via email to