* Re: [PATCH] kdump: Give crashkernel CMA areas unique names
2026-11-06 10:43 [PATCH] kdump: Give crashkernel CMA areas unique names Mikhail Zaslonko
@ 2026-11-06 12:38 ` David Hildenbrand (Arm)
2026-11-06 13:50 ` Usama Arif
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: David Hildenbrand (Arm) @ 2026-11-06 12:38 UTC (permalink / raw)
To: Mikhail Zaslonko, Andrew Morton, Baoquan He
Cc: Mike Rapoport, Pasha Tatashin, Pratyush Yadav, Dave Young,
Jiri Bohac, Usama Arif, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, kexec, linux-mm, linux-kernel
On 11/6/26 11:43, Mikhail Zaslonko wrote:
> reserve_crashkernel_cma() names every CMA area it reserves
> "crashkernel". If the requested size can't be reserved in one piece,
> it falls back to several smaller areas, all with the same name.
> With CONFIG_CMA_SYSFS, cma_sysfs_init() then fails to create the second
> directory:
>
> sysfs: cannot create duplicate filename '/kernel/mm/cma/crashkernel'
>
> and the error path removes the sysfs entries of all CMA areas.
>
> With CONFIG_CMA_DEBUGFS, debugfs refuses the duplicate directories as
> well:
>
> debugfs: 'crashkernel' already exists in 'cma'
>
> so only the first area shows up in debugfs.
>
> Keep the name of the first area and add the index to the others:
> crashkernel, crashkernel1, crashkernel2, ...
>
> Fixes: ab475510e042 ("kdump: implement reserve_crashkernel_cma")
> Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
> ---
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
--
Cheers,
David
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] kdump: Give crashkernel CMA areas unique names
2026-11-06 10:43 [PATCH] kdump: Give crashkernel CMA areas unique names Mikhail Zaslonko
2026-11-06 12:38 ` David Hildenbrand (Arm)
@ 2026-11-06 13:50 ` Usama Arif
2026-11-06 14:13 ` Jiri Bohac
2026-11-07 10:59 ` Mike Rapoport
3 siblings, 0 replies; 5+ messages in thread
From: Usama Arif @ 2026-11-06 13:50 UTC (permalink / raw)
To: Mikhail Zaslonko
Cc: Usama Arif, Andrew Morton, Baoquan He, Mike Rapoport,
Pasha Tatashin, Pratyush Yadav, Dave Young, Jiri Bohac,
David Hildenbrand, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, kexec, linux-mm, linux-kernel
On Fri, 6 Nov 2026 11:43:09 +0100 Mikhail Zaslonko <zaslonko@linux.ibm.com> wrote:
> reserve_crashkernel_cma() names every CMA area it reserves
> "crashkernel". If the requested size can't be reserved in one piece,
> it falls back to several smaller areas, all with the same name.
> With CONFIG_CMA_SYSFS, cma_sysfs_init() then fails to create the second
> directory:
>
> sysfs: cannot create duplicate filename '/kernel/mm/cma/crashkernel'
>
> and the error path removes the sysfs entries of all CMA areas.
>
> With CONFIG_CMA_DEBUGFS, debugfs refuses the duplicate directories as
> well:
>
> debugfs: 'crashkernel' already exists in 'cma'
>
> so only the first area shows up in debugfs.
>
> Keep the name of the first area and add the index to the others:
> crashkernel, crashkernel1, crashkernel2, ...
>
> Fixes: ab475510e042 ("kdump: implement reserve_crashkernel_cma")
> Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
> ---
> Found while adding crashkernel CMA support for s390.
>
> kernel/crash_reserve.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
Thanks for the fix and pointing me to it in [1]!
Acked-by: Usama Arif <usama.arif@linux.dev>
[1] https://lore.kernel.org/all/20261106104309.3669583-1-zaslonko@linux.ibm.com/
>
> diff --git a/kernel/crash_reserve.c b/kernel/crash_reserve.c
> index eee37a11380c..e58318b1e092 100644
> --- a/kernel/crash_reserve.c
> +++ b/kernel/crash_reserve.c
> @@ -483,10 +483,16 @@ void __init reserve_crashkernel_cma(unsigned long long cma_size)
> while (cma_size > reserved_size &&
> crashk_cma_cnt < CRASHKERNEL_CMA_RANGES_MAX) {
>
> + char name[CMA_MAX_NAME];
> struct cma *res;
>
> + /* CMA area names show up in sysfs and debugfs, keep them unique */
> + if (crashk_cma_cnt)
> + snprintf(name, sizeof(name), "crashkernel%d", crashk_cma_cnt);
> + else
> + strscpy(name, "crashkernel");
> if (cma_declare_contiguous(0, request_size, 0, 0, 0, false,
> - "crashkernel", &res)) {
> + name, &res)) {
> /* reservation failed, try half-sized blocks */
> if (request_size <= PAGE_SIZE)
> break;
>
> base-commit: f66469d9905b39d2c260a15d7d6db450f4db67c1
> --
> 2.55.0
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] kdump: Give crashkernel CMA areas unique names
2026-11-06 10:43 [PATCH] kdump: Give crashkernel CMA areas unique names Mikhail Zaslonko
2026-11-06 12:38 ` David Hildenbrand (Arm)
2026-11-06 13:50 ` Usama Arif
@ 2026-11-06 14:13 ` Jiri Bohac
2026-11-07 10:59 ` Mike Rapoport
3 siblings, 0 replies; 5+ messages in thread
From: Jiri Bohac @ 2026-11-06 14:13 UTC (permalink / raw)
To: Mikhail Zaslonko
Cc: Andrew Morton, Baoquan He, Mike Rapoport, Pasha Tatashin,
Pratyush Yadav, Dave Young, David Hildenbrand, Usama Arif,
Heiko Carstens, Vasily Gorbik, Alexander Gordeev, kexec, linux-mm,
linux-kernel
On Fri, Nov 06, 2026 at 11:43:09AM +0100, Mikhail Zaslonko wrote:
> reserve_crashkernel_cma() names every CMA area it reserves
> "crashkernel". If the requested size can't be reserved in one piece,
> it falls back to several smaller areas, all with the same name.
> With CONFIG_CMA_SYSFS, cma_sysfs_init() then fails to create the second
> directory:
>
> sysfs: cannot create duplicate filename '/kernel/mm/cma/crashkernel'
>
> and the error path removes the sysfs entries of all CMA areas.
>
> With CONFIG_CMA_DEBUGFS, debugfs refuses the duplicate directories as
> well:
>
> debugfs: 'crashkernel' already exists in 'cma'
>
> so only the first area shows up in debugfs.
>
> Keep the name of the first area and add the index to the others:
> crashkernel, crashkernel1, crashkernel2, ...
>
> Fixes: ab475510e042 ("kdump: implement reserve_crashkernel_cma")
> Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Thanks for fixing this.
I don't think we really need the special case for crashk_cma_cnt == 0
and that "crashkernel0" would be fine. But I don't mind either way.
Acked-by: Jiri Bohac <jbohac@suse.cz>
--
Jiri Bohac <jbohac@suse.cz>
SUSE Labs, Prague, Czechia
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] kdump: Give crashkernel CMA areas unique names
2026-11-06 10:43 [PATCH] kdump: Give crashkernel CMA areas unique names Mikhail Zaslonko
` (2 preceding siblings ...)
2026-11-06 14:13 ` Jiri Bohac
@ 2026-11-07 10:59 ` Mike Rapoport
3 siblings, 0 replies; 5+ messages in thread
From: Mike Rapoport @ 2026-11-07 10:59 UTC (permalink / raw)
To: Andrew Morton, Baoquan He, Mikhail Zaslonko
Cc: Mike Rapoport, Pasha Tatashin, Pratyush Yadav, Dave Young,
Jiri Bohac, David Hildenbrand, Usama Arif, Heiko Carstens,
Vasily Gorbik, Alexander Gordeev, kexec, linux-mm, linux-kernel
From: Mike Rapoport (Microsoft) <rppt@kernel.org>
On Fri, 06 Nov 2026 11:43:09 +0100, Mikhail Zaslonko wrote:
> reserve_crashkernel_cma() names every CMA area it reserves
> "crashkernel". If the requested size can't be reserved in one piece,
> it falls back to several smaller areas, all with the same name.
> With CONFIG_CMA_SYSFS, cma_sysfs_init() then fails to create the second
> directory:
>
> sysfs: cannot create duplicate filename '/kernel/mm/cma/crashkernel'
>
> [...]
Applied to kexec-next branch of liveupdate/linux.git tree, thanks!
[1/1] kdump: Give crashkernel CMA areas unique names
commit: 941aef93e9e1df74f0ef0fa8653c435613131243
tree: https://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux
branch: kexec-next
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 5+ messages in thread