Re: [PATCH] mm/cma: reject long-term pins of HugeTLB folios overlapping crashkernel CMA
From: Michal Hocko
Date: Thu Nov 26 2026 - 03:21:37 EST
On Wed 25-11-26 23:43:40, David Hildenbrand 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. :/
Yes, I would tend to agree. While there is a risk of stale writes from
RDMA on long term pinned pages on the crash kernel I would simply advise
admins to not use cma backing for crash kernel on those setups unless
they are willing to live with unreliable dumping.
I can see how reusing hugetlb cmas might be really helpful for
crashkernel as this can consume a lot of memory and you rarely care
about the content in the crash kernel - same as any other userspace
memory.
--
Michal Hocko
SUSE Labs