Activating a thin device waits for an RCU grace period in thin_ctr(), and removing one waits for another in thin_dtr(). Tools that create and remove thin snapshots for every container, such as the containerd devmapper snapshotter, pay for both each time.
Patch 1 drops the grace period from thin_ctr(), which isn't needed. Patch 2 lets the active_thins walkers skip thins whose last reference is gone, so that thin_dtr() can free the thin with kfree_rcu() instead of waiting. Activating a thin device gets 51% faster and removing one 15%. Signed-off-by: Qiliang Yuan <[email protected]> --- Qiliang Yuan (2): dm thin: drop the grace period from thin_ctr() dm thin: free thins with kfree_rcu() instead of waiting in thin_dtr() drivers/md/dm-thin.c | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) --- base-commit: 23c62304dde29abe92013d85910d03a77dada35d change-id: 20261114-bug-dm-thin-rcu-gp-d29d4b74a0b8 Best regards, -- Qiliang Yuan <[email protected]>
