[PATCH v8 10/11] arm64: kexec_file: Fix CMA segment placement retries
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Thu Nov 12 06:14:49 PST 2026
> The file-based kexec system call places segments with kexec_add_buffer(),
> which takes them from CMA when kexec_alloc_contig() succeeds, to avoid
> copying the payload at kexec time.
>
> When load_other_segments() cannot place the initrd or the DTB, the
> segments of the attempt are dropped but their CMA pages are leaked.
> Release them with kexec_rollback_segments() in the retry loop and in the
> error path of load_other_segments().
>
> The loop makes progress by advancing buf_min past a segment placed by the
> walk. kexec_alloc_contig() ignores buf_min, so once the pages of a CMA
> segment are released, the next attempt can get the same region again and
> the retry makes no progress. Disable CMA for the retry.
>
> A CMA segment can be anywhere in RAM, so moving buf_min to its end can
> [ ... ]
> Cc: Yeoreum Yun <yeoreum.yun at arm.com>
> Cc: Baoquan He <bhe at redhat.com>
> Cc: stable at vger.kernel.org
> Fixes: 07d24902977e ("kexec: enable CMA based contiguous allocation")
> Signed-off-by: Jinjie Ruan <ruanjinjie at huawei.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261112133418.4044428-1-ruanjinjie@huawei.com?part=10
More information about the kexec
mailing list