On 3/31/26 19:12, Mikhail Gavrilov wrote:
> 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.
Ah, crap I wanted to double check exactly that but then had no time for it.
>
> 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()?
Alex already applied the v7 so it would probably be best if you provide a delta
patch on top of that.
It's then up to Alex if he can squash the patches together before upstreaming.
Regards,
Christian.
>
> Thanks,
> Mikhail