ublk: fix maple tree lockdep warning and cleanup
Status from this message: Applied, thanks!
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | ublk: fix maple tree lockdep warning in ublk_buf_cleanupdrivers/ | +4 | 0 replies | |
| 2/3 | ublk: refactor common helper ublk_shmem_remove_ranges()drivers/ | +29 | 0 replies | |
| 3/3 | ublk: avoid unpinning pages under maple tree spinlockdrivers/ | +46 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] ublk: fix maple tree lockdep warning and cleanup
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(-)
Signature · 1 line
2.53.0