On Fri, Jul 21, 2023 at 03:50:20PM -0500, Bob Pearson wrote: > Currently the rxe driver stores NULL in the pool xarray to > indicate that the pool element should not be looked up from its > index. This prevents looping over pool elements during driver > cleanup. This patch adds a new valid field to struct rxe_pool_elem > as an alternative way to accomplish the same thing. Wah? Why? Yuk. > @@ -249,13 +252,6 @@ int __rxe_put(struct rxe_pool_elem *elem) > > void __rxe_finalize(struct rxe_pool_elem *elem, bool sleepable) > { > - gfp_t gfp_flags = sleepable ? GFP_KERNEL : GFP_ATOMIC; > - struct xarray *xa = &elem->pool->xa; > - unsigned long flags; > - void *xa_ret; > - > - xa_lock_irqsave(xa, flags); > - xa_ret = __xa_store(xa, elem->index, elem, gfp_flags); > - xa_unlock_irqrestore(xa, flags); > - WARN_ON(xa_err(xa_ret)); > + /* allow looking up element from index */ > + smp_store_release(&elem->valid, 1); > } That is horrible, why? Jason