Re: [PATCH] mm: swap: check for xa_zero_entry() on vma in swapoff path

From: David Hildenbrand
Date: Mon Aug 11 2025 - 12:11:52 EST


On 11.08.25 17:48, Lorenzo Stoakes wrote:
On Mon, Aug 11, 2025 at 05:39:32PM +0200, David Hildenbrand wrote:


I could make a function that frees all new vmas and destroys the tree
specifically for this failure state?

I think the problem is that some page tables were already copied, so we
would have to zap them as well.

This shouldn't be too much more egregious?

The issues arise when it might be an OOM issue, but if it's a fatal signal we
can take the time to clean up.


Maybe just factoring stuff from the exit_mmap() function could be one way to
do it.

Is exit_mmap() a problem here? Or maybe I don't understand what you're getting
at.

We are dropping the write lock in between, allowing for these races.

--
Cheers,

David / dhildenb