Re: [PATCH v3 2/3] mm: memory-hotplug: check folio ref count first in do_migrate_range

From: David Hildenbrand
Date: Mon Feb 17 2025 - 04:30:48 EST


On 17.02.25 02:43, Wupeng Ma wrote:
From: Ma Wupeng <mawupeng1@xxxxxxxxxx>

If a folio has an increased reference count, folio_try_get() will acquire
it, perform necessary operations, and then release it. In the case of a
poisoned folio without an elevated reference count (which is unlikely for
memory-failure), folio_try_get() will simply bypass it.

Therefore, relocate the folio_try_get() function, responsible for checking
and acquiring this reference count at first.

Signed-off-by: Ma Wupeng <mawupeng1@xxxxxxxxxx>
---

Acked-by: David Hildenbrand <david@xxxxxxxxxx>

--
Cheers,

David / dhildenb