mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] dm thin: stop waiting for grace periods when activating and removing thins
@ 2026-11-16  5:12 Qiliang Yuan
  2026-11-16  5:12 ` [PATCH 1/2] dm thin: drop the grace period from thin_ctr() Qiliang Yuan
  2026-11-16  5:12 ` [PATCH 2/2] dm thin: free thins with kfree_rcu() instead of waiting in thin_dtr() Qiliang Yuan
  0 siblings, 2 replies; 3+ messages in thread
From: Qiliang Yuan @ 2026-11-16  5:12 UTC (permalink / raw)
  To: Alasdair Kergon, Mike Snitzer, Mikulas Patocka, Benjamin Marzinski
  Cc: dm-devel, linux-kernel, Qiliang Yuan

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 <qiliang.yuan@linux.dev>
---
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 <qiliang.yuan@linux.dev>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-16  5:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-16  5:12 [PATCH 0/2] dm thin: stop waiting for grace periods when activating and removing thins Qiliang Yuan
2026-11-16  5:12 ` [PATCH 1/2] dm thin: drop the grace period from thin_ctr() Qiliang Yuan
2026-11-16  5:12 ` [PATCH 2/2] dm thin: free thins with kfree_rcu() instead of waiting in thin_dtr() Qiliang Yuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®