Re: [PATCH v3 08/30] kho: don't unpreserve memory during abort

From: Jason Gunthorpe
Date: Thu Aug 14 2025 - 09:42:49 EST


On Thu, Aug 07, 2025 at 01:44:14AM +0000, Pasha Tatashin wrote:
> static int __kho_abort(void)
> {
> - int err = 0;
> - unsigned long order;
> - struct kho_mem_phys *physxa;
> -
> - xa_for_each(&kho_out.track.orders, order, physxa) {
> - struct kho_mem_phys_bits *bits;
> - unsigned long phys;
> -
> - xa_for_each(&physxa->phys_bits, phys, bits)
> - kfree(bits);
> -
> - xa_destroy(&physxa->phys_bits);
> - kfree(physxa);
> - }
> - xa_destroy(&kho_out.track.orders);

Now nothing ever cleans this up :\

Are you sure the issue isn't in the caller that it shouldn't be
calling kho abort until all the other stuff is cleaned up first?

I feel like this is another case of absuing globals gives an unclear
lifecycle model.

Jason