Re: [PATCH v2 0/2] mm: fix deadlock on the folio lock when migrating and splitting folios

From: David Hildenbrand

Date: Wed Nov 25 2026 - 05:31:17 EST


On Tue, 24 Nov 2026 08:56:42 +0100, David Hildenbrand (Arm) wrote:
> Whenever we allocate memory with __GFP_FS while holding folio locks, we
> can deadlock on the folio lock when triggering direct reclaim or
> compaction.
>
> For example, 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.
>
> [...]

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/b4f63023
[2/2] mm/migrate: allocate destination folios before locking a batch
https://git.kernel.org/mm/core/c/51fdc28d

--
Cheers,

David