aboutsummaryrefslogtreecommitdiffstats
diff options
-rw-r--r--mm/memory-failure.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 1b8d0bade04a7..51508a55c4055 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -172,23 +172,11 @@ static int __page_handle_poison(struct page *page)
{
int ret;
- /*
- * zone_pcp_disable() can't be used here. It will
- * hold pcp_batch_high_lock and dissolve_free_hugetlb_folio() might hold
- * cpu_hotplug_lock via static_key_slow_dec() when hugetlb vmemmap
- * optimization is enabled. This will break current lock dependency
- * chain and leads to deadlock.
- * Disabling pcp before dissolving the page was a deterministic
- * approach because we made sure that those pages cannot end up in any
- * PCP list. Draining PCP lists expels those pages to the buddy system,
- * but nothing guarantees that those pages do not get back to a PCP
- * queue if we need to refill those.
- */
+ zone_pcp_disable(page_zone(page));
ret = dissolve_free_hugetlb_folio(page_folio(page));
- if (!ret) {
- drain_all_pages(page_zone(page));
+ if (!ret)
ret = take_page_off_buddy(page);
- }
+ zone_pcp_enable(page_zone(page));
return ret;
}