Re: [PATCH 0/2] mm: fix deadlock on the folio lock due to inode eviction
From: David Hildenbrand
Date: Mon Nov 23 2026 - 11:27:59 EST
On Sun, 22 Nov 2026 13:42:16 +0100, David Hildenbrand (Arm) wrote:
> Whenever we allocate memory with folio locks held and trigger direct
> reclaim, we might end up trying to evict an unused inode. Evicting
> inodes with a populated page cache takes folio locks, and if we happen
> to need one of the folio locks we already hold, we'll deadlock.
>
> This can, in general, not happen if we also pin the folio's inode: for
> example, through a VMA that cannot go away concurrently. However, we
> have some scenarios where we hold folio locks without pinning inodes.
> Examples include page migration and some folio split users.
>
> [...]
Applied, thanks!
tree: mm/core.git
branch: for-next-fixes
Applied patches will appear soon in mm-next, followed by linux-next.
Please report any outstanding bugs that were missed during review, so we
can either drop the patch series or decide how to fix it up.
It is encouraged to provide Acked-bys, Reviewed-bys, and Tested-bys even
though the patches have already been applied. If possible, patch trailers
will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. Further, this is not a guarantee that the
patches will go upstream. If in doubt, please check the listed branch.
[1/2] mm/huge_memory: use NOFS when allocating while splitting folios
https://git.kernel.org/mm/core/c/acc29031
[2/2] mm/migrate: allocate destination folios before locking a batch
https://git.kernel.org/mm/core/c/15f32855
--
Cheers,
David