]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
memblock: Add reserve_mem debugfs info
authorGuilherme G. Piccoli <gpiccoli@igalia.com>
Tue, 24 Mar 2026 01:22:18 +0000 (22:22 -0300)
committerMike Rapoport (Microsoft) <rppt@kernel.org>
Wed, 1 Apr 2026 08:19:43 +0000 (11:19 +0300)
commit0709682cdb4ac77e3f78ea9c10d7f74b41a12518
tree09dc67bbbaeacfc7c4f6a835e2bbec747a902da6
parentf7f4a21c2a51710a06965cc9c1252821fc925544
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>
mm/memblock.c
tools/testing/memblock/linux/string_helpers.h [new file with mode: 0644]