From: "Guilherme G. Piccoli" <gpiccoli@igalia.com>
To: SeongJae Park <sj@kernel.org>, rppt@kernel.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
kernel-dev@igalia.com, kernel@gpiccoli.net,
Andrew Morton <akpm@linux-foundation.org>,
Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH V2 2/2] mm/memblock: Add reserve_mem debugfs info
Date: Fri, 13 Mar 2026 18:09:10 -0300 [thread overview]
Message-ID: <62b3bcca-7e4b-09ce-4996-5b67f066e123@igalia.com> (raw)
In-Reply-To: <20260305014430.79405-1-sj@kernel.org>
Hi SJ and Mike, thanks for both your review! I'll respond the 2 messages
here.
First regarding Mike's concern from the other email:
>> +#include <linux/string_helpers.h>
>This will break tests in tools/testing/memblock, please add a stub there.
Sure, will do it!
On 04/03/2026 22:44, SeongJae Park wrote:
>[...]
>> 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.
>
> Asking out of curiosity. The previous patch has added the error log for
> failure cases. Could checking the kernel log to see if it was failed be an
> option?
>
> I think this debugfs approach is easier to check for the user space, though.
> If that is the reason of this patch, adding the clarity would be nice for a
> theoretical case that debugfs cannot be mounted.
>
Exactly that! Not only debugfs way is more convenient for checking that,
but it feels a bit weird for me to assume the reservation worked by
checking for errors and if none, all fine. It's valid, but as a matter
of taste, I prefer checking the file. And not only that: imagine we have
more than one setting in the cmdline, for other usages like ftrace.
Easier to have the debugfs showing the succeeding ones, by name and
size, ready to be used heheh
Do you have a suggestion on how should I mention this in the commit
message? Is that discussion enough maybe, for future reference? I feel
mentioning that userspace will use the information from the file seems
enough for a commit message; but I'm totally open for your suggestions
on how to improve the wording here
>> + if (!(IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK) || reserved_mem_count))
>> + return 0;
>
> One trivial comment. I'd slightly prefer having one less parentheses level as
> a tradeoff of having one more exclamation mark, e.g.,
>
> if (!IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK) && !reserved_mem_count)
>
Good! Unless Mike is against that, I can easily change it.
>
> So, we get two level of nested ifdef... I'm wondering if returning earlier
> when CONFIG_ARCH_KEEP_MEMBLOCK is undefined is easier to read. E.g.,
>
> #ifndef CONFIG_ARCH_KEEP_MEMBLOCK
> return 0;
> #endif
>
> debugfs_create_file("memory", 0444, root,
> [...]
>
>> return 0;
>
> Very trivial comment. Why don't you keep the original blank line above the
> return statemtnt?
>
About the ifdefs, as per Mike's comment, I'll rework it in a helper. And
the blank like, I have no answer heh
Likely a braino? I can certainly keep it.
Thanks again you two for the suggestions,
Guilherme
next prev parent reply other threads:[~2026-03-13 21:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 20:14 [PATCH V2 0/2] Small improvements to reserve_mem, take 2 Guilherme G. Piccoli
2026-03-04 20:14 ` [PATCH V2 1/2] mm/memblock: Print out errors on reserve_mem parser Guilherme G. Piccoli
2026-03-05 1:14 ` SeongJae Park
2026-03-13 20:59 ` Guilherme G. Piccoli
2026-03-04 20:14 ` [PATCH V2 2/2] mm/memblock: Add reserve_mem debugfs info Guilherme G. Piccoli
2026-03-05 1:44 ` SeongJae Park
2026-03-13 21:09 ` Guilherme G. Piccoli [this message]
2026-03-14 0:42 ` SeongJae Park
2026-03-07 8:35 ` Mike Rapoport
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=62b3bcca-7e4b-09ce-4996-5b67f066e123@igalia.com \
--to=gpiccoli@igalia.com \
--cc=akpm@linux-foundation.org \
--cc=kernel-dev@igalia.com \
--cc=kernel@gpiccoli.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rostedt@goodmis.org \
--cc=rppt@kernel.org \
--cc=sj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox