Re: [PATCH] mm/cma: reject long-term pins of HugeTLB folios overlapping crashkernel CMA
From: David Hildenbrand (Arm)
Date: Fri Nov 27 2026 - 13:51:12 EST
On 11/27/26 18:43, Jiri Bohac wrote:
> On Wed, Nov 25, 2026 at 11:43:40PM +0100, David Hildenbrand (Arm) wrote:
>> On 11/25/26 16:51, Sang-Heon Jeon wrote:
>>> crashkernel=size,cma uses existing hugetlb_cma memory, so
>>> crashk_cma_ranges[] may contain HugeTLB folios. HugeTLB folios allocated
>>> from hugetlb_cma can be long-term pinned without being migrated.
>>>
>>> After a crash, the crash kernel uses the memory in crashk_cma_ranges[],
>>> but a device can still write to a long-term pinned folio.
>>>
>>> So reject long-term pins of HugeTLB folios overlapping
>>> crashk_cma_ranges[].
>>>
>>> Signed-off-by: Sang-Heon Jeon <ekffu200098@xxxxxxxxx>
>>> ---
>>> The above scenario is only possible with the two patches below applied.
>>> Currently only linux-next, which is targeting v7.5, has both of them.
>>>
>>> "mm/hugetlb: allow crashkernel to reuse hugetlb CMA memory" (kexec-next)
>>
>> I think that's a real problem with this thing.
>>
>> The solution is not to disallow long-term pinning. :/
>
> This patch does not disallow or break the long-term pinning. It just makes
> sure the pages are migrated away from the CMA before get_user_pages pins them.
It disallows long-term pinning.
So you have to migrate.
Good luck migrating a 1 GiB folio.
--
Cheers,
David