diff options
| author | Vishal Moola (Oracle) <[email protected]> | 2025-04-01 02:10:24 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2025-04-12 00:32:36 +0000 |
| commit | a84edd52f0a0fa193f0f685769939cf84510755b (patch) | |
| tree | e2fb77bd9a6dedd531416f81ab64fc84df12719f /drivers/fpga/tests/fpga-mgr-test.c | |
| parent | lib/iov_iter: fix to increase non slab folio refcount (diff) | |
| download | kernel-a84edd52f0a0fa193f0f685769939cf84510755b.tar.gz kernel-a84edd52f0a0fa193f0f685769939cf84510755b.zip | |
mm/compaction: fix bug in hugetlb handling pathway
The compaction code doesn't take references on pages until we're certain
we should attempt to handle it.
In the hugetlb case, isolate_or_dissolve_huge_page() may return -EBUSY
without taking a reference to the folio associated with our pfn. If our
folio's refcount drops to 0, compound_nr() becomes unpredictable, making
low_pfn and nr_scanned unreliable. The user-visible effect is minimal -
this should rarely happen (if ever).
Fix this by storing the folio statistics earlier on the stack (just like
the THP and Buddy cases).
Also revert commit 66fe1cf7f581 ("mm: compaction: use helper compound_nr
in isolate_migratepages_block") to make backporting easier.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 369fa227c219 ("mm: make alloc_contig_range handle free hugetlb pages")
Signed-off-by: Vishal Moola (Oracle) <[email protected]>
Acked-by: Oscar Salvador <[email protected]>
Reviewed-by: Zi Yan <[email protected]>
Cc: Miaohe Lin <[email protected]>
Cc: Oscar Salvador <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'drivers/fpga/tests/fpga-mgr-test.c')
0 files changed, 0 insertions, 0 deletions
