On Tue, Mar 31, 2026 at 7:38 PM Alex Deucher <[email protected]> wrote:
>
> Applied.  Thanks!
>

Hi Christian, Alex,

While testing v7, I noticed that xa_erase() and xa_alloc_cyclic()
use plain xa_lock()/xa_unlock() regardless of XA_FLAGS_LOCK_IRQ —
the flag only affects lockdep annotations, not runtime locking.

The XArray API provides separate _irq variants for this:
xa_alloc_cyclic_irq() and xa_erase_irq(), both defined as inlines
in include/linux/xarray.h using xa_lock_irq/xa_unlock_irq.

I confirmed this by hitting the same lockdep WARNING with v6
(which has the same locking), and by reading lib/xarray.c:

  void *xa_erase(struct xarray *xa, unsigned long index)
  {
      xa_lock(xa);              // plain spin_lock, not _irq
      entry = __xa_erase(xa, index);
      xa_unlock(xa);
      return entry;
  }

Should I send a v8 using xa_alloc_cyclic_irq() and xa_erase_irq()?

Thanks,
Mikhail

Reply via email to