[PATCH 0/2] Export kdump crashkernel CMA ranges

Sourabh Jain posted 2 patches 3 months ago
.../ABI/testing/sysfs-kernel-kexec-kdump      | 53 +++++++++++++++++++
kernel/ksysfs.c                               | 17 ++++++
2 files changed, 70 insertions(+)
create mode 100644 Documentation/ABI/testing/sysfs-kernel-kexec-kdump
[PATCH 0/2] Export kdump crashkernel CMA ranges
Posted by Sourabh Jain 3 months ago
/sys/kernel/kexec_crash_cma_ranges to export all CMA regions reserved
for the crashkernel to user-space. This enables user-space tools
configuring kdump to determine the amount of memory reserved for the
crashkernel. When CMA is used for crashkernel allocation, tools can use
this information to warn users that attempting to capture user pages
while CMA reservation is active may lead to unreliable or incomplete
dump capture.

While adding documentation for the new sysfs interface, I realized that
there was no ABI document for the existing kexec and kdump sysfs
interfaces, so I added one.

The first patch adds the ABI documentation for the existing kexec and
kdump sysfs interfaces, and the second patch adds the
/sys/kernel/kexec_crash_cma_ranges sysfs interface along with its
corresponding ABI documentation.

*Seeking opinions*
There are already four kexec/kdump sysfs entries under /sys/kernel/,
and this patch series adds one more. Should we consider moving them to
a separate directory, such as /sys/kernel/kexec, to avoid polluting
/sys/kernel/? For backward compatibility, we can create symlinks at
the old locations for sometime and remove them in the future.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Baoquan he <bhe@redhat.com>
Cc: Jiri Bohac <jbohac@suse.cz>
Cc: Shivang Upadhyay <shivangu@linux.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: kexec@lists.infradead.org

Sourabh Jain (2):
  Documentation/ABI: add kexec and kdump sysfs interface
  crash: export crashkernel CMA reservation to userspace

 .../ABI/testing/sysfs-kernel-kexec-kdump      | 53 +++++++++++++++++++
 kernel/ksysfs.c                               | 17 ++++++
 2 files changed, 70 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-kernel-kexec-kdump

-- 
2.51.0
Re: [PATCH 0/2] Export kdump crashkernel CMA ranges
Posted by Baoquan he 3 months ago
On 11/03/25 at 09:28am, Sourabh Jain wrote:
> /sys/kernel/kexec_crash_cma_ranges to export all CMA regions reserved
> for the crashkernel to user-space. This enables user-space tools
> configuring kdump to determine the amount of memory reserved for the
> crashkernel. When CMA is used for crashkernel allocation, tools can use
> this information to warn users that attempting to capture user pages
> while CMA reservation is active may lead to unreliable or incomplete
> dump capture.
> 
> While adding documentation for the new sysfs interface, I realized that
> there was no ABI document for the existing kexec and kdump sysfs
> interfaces, so I added one.
> 
> The first patch adds the ABI documentation for the existing kexec and
> kdump sysfs interfaces, and the second patch adds the
> /sys/kernel/kexec_crash_cma_ranges sysfs interface along with its
> corresponding ABI documentation.
> 
> *Seeking opinions*
> There are already four kexec/kdump sysfs entries under /sys/kernel/,
> and this patch series adds one more. Should we consider moving them to
> a separate directory, such as /sys/kernel/kexec, to avoid polluting
> /sys/kernel/? For backward compatibility, we can create symlinks at
> the old locations for sometime and remove them in the future.

That sounds a good idea, will you do it in v2? Because otherwise the
kexec_crash_cma_ranges need be moved too.


> 
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Baoquan he <bhe@redhat.com>
> Cc: Jiri Bohac <jbohac@suse.cz>
> Cc: Shivang Upadhyay <shivangu@linux.ibm.com>
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: kexec@lists.infradead.org
> 
> Sourabh Jain (2):
>   Documentation/ABI: add kexec and kdump sysfs interface
>   crash: export crashkernel CMA reservation to userspace
> 
>  .../ABI/testing/sysfs-kernel-kexec-kdump      | 53 +++++++++++++++++++
>  kernel/ksysfs.c                               | 17 ++++++
>  2 files changed, 70 insertions(+)
>  create mode 100644 Documentation/ABI/testing/sysfs-kernel-kexec-kdump
> 
> -- 
> 2.51.0
>
Re: [PATCH 0/2] Export kdump crashkernel CMA ranges
Posted by Sourabh Jain 3 months ago

On 05/11/25 08:45, Baoquan he wrote:
> On 11/03/25 at 09:28am, Sourabh Jain wrote:
>> /sys/kernel/kexec_crash_cma_ranges to export all CMA regions reserved
>> for the crashkernel to user-space. This enables user-space tools
>> configuring kdump to determine the amount of memory reserved for the
>> crashkernel. When CMA is used for crashkernel allocation, tools can use
>> this information to warn users that attempting to capture user pages
>> while CMA reservation is active may lead to unreliable or incomplete
>> dump capture.
>>
>> While adding documentation for the new sysfs interface, I realized that
>> there was no ABI document for the existing kexec and kdump sysfs
>> interfaces, so I added one.
>>
>> The first patch adds the ABI documentation for the existing kexec and
>> kdump sysfs interfaces, and the second patch adds the
>> /sys/kernel/kexec_crash_cma_ranges sysfs interface along with its
>> corresponding ABI documentation.
>>
>> *Seeking opinions*
>> There are already four kexec/kdump sysfs entries under /sys/kernel/,
>> and this patch series adds one more. Should we consider moving them to
>> a separate directory, such as /sys/kernel/kexec, to avoid polluting
>> /sys/kernel/? For backward compatibility, we can create symlinks at
>> the old locations for sometime and remove them in the future.
> That sounds a good idea, will you do it in v2? Because otherwise the
> kexec_crash_cma_ranges need be moved too.

Yes I will include it in v2.

Thanks,
Sourabh Jain
Re: [PATCH 0/2] Export kdump crashkernel CMA ranges
Posted by Sourabh Jain 3 months ago
Cc others who can provide input.

On 03/11/25 09:28, Sourabh Jain wrote:
> /sys/kernel/kexec_crash_cma_ranges to export all CMA regions reserved
> for the crashkernel to user-space. This enables user-space tools
> configuring kdump to determine the amount of memory reserved for the
> crashkernel. When CMA is used for crashkernel allocation, tools can use
> this information to warn users that attempting to capture user pages
> while CMA reservation is active may lead to unreliable or incomplete
> dump capture.
>
> While adding documentation for the new sysfs interface, I realized that
> there was no ABI document for the existing kexec and kdump sysfs
> interfaces, so I added one.
>
> The first patch adds the ABI documentation for the existing kexec and
> kdump sysfs interfaces, and the second patch adds the
> /sys/kernel/kexec_crash_cma_ranges sysfs interface along with its
> corresponding ABI documentation.
>
> *Seeking opinions*
> There are already four kexec/kdump sysfs entries under /sys/kernel/,
> and this patch series adds one more. Should we consider moving them to
> a separate directory, such as /sys/kernel/kexec, to avoid polluting
> /sys/kernel/? For backward compatibility, we can create symlinks at
> the old locations for sometime and remove them in the future.
>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Baoquan he <bhe@redhat.com>
> Cc: Jiri Bohac <jbohac@suse.cz>
> Cc: Shivang Upadhyay <shivangu@linux.ibm.com>
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: kexec@lists.infradead.org
>
> Sourabh Jain (2):
>    Documentation/ABI: add kexec and kdump sysfs interface
>    crash: export crashkernel CMA reservation to userspace
>
>   .../ABI/testing/sysfs-kernel-kexec-kdump      | 53 +++++++++++++++++++
>   kernel/ksysfs.c                               | 17 ++++++
>   2 files changed, 70 insertions(+)
>   create mode 100644 Documentation/ABI/testing/sysfs-kernel-kexec-kdump
>