[PATCH 12/46] mm/huge_memory: fix livelock on device private folio

sashiko-bot at kernel.org sashiko-bot at kernel.org
Mon Oct 26 17:12:38 PDT 2026


> From: Josef Bacik <josef at toxicpanda.com>
> 
> If do_huge_pmd_device_private() cannot lock the folio, it simply returns
> to try again on the next fault.
> 
> Just like we did in commit b570f37a2ce4 ("mm: Fix a hmm_range_fault()
> livelock / starvation problem"), let's wait for the softleaf entry,
> which will drop the PTL and wait until the folio was unlocked. This is
> precisely what we do in do_swap_page() with device-private folios. This
> avoids possibly livelocking.
> 
> Update softleaf_entry_wait_on_locked() documentation to clarify that
> device-private entries wait until the folio is unlocked.
> 
> There seems to be no compelling reason to backport this to stable
> kernels unless we actually see problems there.
> 
> Fix generated by an LLM and sent by Josef Bacik in private.
> 
> Fixes: 4964099163d0 ("mm/memory/fault: add THP fault handling for zone device private pages")
> Signed-off-by: Josef Bacik <josef at toxicpanda.com>
> [ david: simplify patch description, fixup softleaf_entry_wait_on_locked description]
> Signed-off-by: David Hildenbrand (Arm) <david at kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261027-fixes_core-v1-0-6f74bec9a5bb@kernel.org?part=12




More information about the kexec mailing list