mirror-linux/tools/testing/memblock/linux
Guilherme G. Piccoli 0709682cdb memblock: Add reserve_mem debugfs info
When using the "reserve_mem" parameter, users aim at having an
area that (hopefully) persists across boots, so pstore infrastructure
(like ramoops module) can make use of that to save oops/ftrace logs,
for example.

There is no easy way to determine if this kernel parameter is properly
set though; the kernel doesn't show information about this memory in
memblock debugfs, neither in /proc/iomem nor dmesg. This is a relevant
information for tools like kdumpst[0], to determine if it's reliable
to use the reserved area as ramoops persistent storage; checking only
/proc/cmdline is not sufficient as it doesn't tell if the reservation
effectively succeeded or not.

Add here a new file under memblock debugfs showing properly set memory
reservations, with name and size as passed to "reserve_mem". Notice that
if no "reserve_mem=" is passed on command-line or if the reservation
attempts fail, the file is not created.

[0] https://aur.archlinux.org/packages/kdumpst

Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Link: https://patch.msgid.link/20260324012839.1991765-2-gpiccoli@igalia.com
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
2026-04-01 11:19:43 +03:00
..
kernel.h memblock test: fix implicit declaration of function 'isspace' 2024-08-06 08:21:25 +03:00
kmemleak.h
memory_hotplug.h memblock tests: change build options to run-time options 2022-07-20 10:46:33 +03:00
mmzone.h memblock tests: include memory_hotplug.h in mmzone.h as kernel dose 2024-08-06 08:17:49 +03:00
mutex.h memblock tests: Fix mutex related build error 2025-04-07 09:28:01 +03:00
printk.h
string_helpers.h memblock: Add reserve_mem debugfs info 2026-04-01 11:19:43 +03:00