All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ublk: fix maple tree lockdep warning and cleanup
@ 2026-04-23  3:30 Ming Lei
  2026-04-23  3:30 ` [PATCH 1/3] ublk: fix maple tree lockdep warning in ublk_buf_cleanup Ming Lei
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ming Lei @ 2026-04-23  3:30 UTC (permalink / raw)
  To: Jens Axboe, linux-block
  Cc: Caleb Sander Mateos, Liam R . Howlett, Shin'ichiro Kawasaki,
	Ming Lei

Hello Jens,

Fix the lockdep warning reported by Jens when running ublk selftests
with CONFIG_PROVE_RCU=y:

  lib/maple_tree.c:759 suspicious rcu_dereference_check() usage!

ublk_buf_cleanup() was iterating the maple tree without holding
mas_lock, triggering the splat from mas_find()'s internal
rcu_dereference_check().

Patch 1 fixes the warning by adding mas_lock around the iteration.
Patch 2 refactors the duplicated walk+erase+unpin loop into a shared
ublk_shmem_remove_ranges() helper. Patch 3 avoids holding the maple
tree spinlock across page unpinning by batching erased ranges into a
temporary xarray.


Thanks,

Ming Lei (3):
  ublk: fix maple tree lockdep warning in ublk_buf_cleanup
  ublk: refactor common helper ublk_shmem_remove_ranges()
  ublk: avoid unpinning pages under maple tree spinlock

 drivers/block/ublk_drv.c | 111 ++++++++++++++++++++++++---------------
 1 file changed, 70 insertions(+), 41 deletions(-)

-- 
2.53.0


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

end of thread, other threads:[~2026-04-23 10:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-23  3:30 [PATCH 0/3] ublk: fix maple tree lockdep warning and cleanup Ming Lei
2026-04-23  3:30 ` [PATCH 1/3] ublk: fix maple tree lockdep warning in ublk_buf_cleanup Ming Lei
2026-04-23  3:30 ` [PATCH 2/3] ublk: refactor common helper ublk_shmem_remove_ranges() Ming Lei
2026-04-23  3:30 ` [PATCH 3/3] ublk: avoid unpinning pages under maple tree spinlock Ming Lei
2026-04-23 10:55 ` [PATCH 0/3] ublk: fix maple tree lockdep warning and cleanup Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.