From: Mike Rapoport <rppt@kernel.org>
To: Israel Batista <linux@israelbatista.dev.br>
Cc: david@redhat.com, lorenzo.stoakes@oracle.com,
akpm@linux-foundation.org, linux-mm@kvack.org,
osandov@osandov.com, linux-debuggers@vger.kernel.org
Subject: Re: [PATCH v2 0/3] mm: Convert memory block states (MEM_*) macros to
Date: Thu, 30 Oct 2025 16:57:33 +0200 [thread overview]
Message-ID: <aQN83UYU60nVnEcc@kernel.org> (raw)
In-Reply-To: <20251029195617.2210700-1-linux@israelbatista.dev.br>
On Wed, Oct 29, 2025 at 07:56:26PM +0000, Israel Batista wrote:
> The MEM_* constants indicating the state of a memory block are
> currently defined as macros, meaning their definitions will be omitted
> from the debuginfo on most kernel builds. This makes it harder for
> debuggers to correctly map the block state at runtime, which can be
> quite useful when analysing errors related to memory hot plugging and
> unplugging with tools such as drgn.
>
> Converting the constants to an enum would ensure the correct information
> is emitted by the compiler and available for the debugger, without needing
> to hard-code them into the debugger and track their changes.
>
> This patch series aims to replace the current macros with a newly
> created enum named memory_block_state, while also taking advantage of
> the compile time guarantees that we get when using enums.
>
> The first patch does the conversion of the macros to an enum, while the
> 2nd and 3rd patches use this enum to clean up some type declarations and
> make sure that only valid values are used.
>
> ---
>
> Link: https://lore.kernel.org/linux-mm/20251026162156.12141-1-linux@israelbatista.dev.br/ [v1]
>
> v1 -> v2
> - Rename the enum to make it more descriptive.
> - Let the enum auto-generate the values, as the (1<<X) pattern could be
> misleading and they're not exposed to userspace.
> - Change the type signature from unsigned long to enum memory_block_state
> where suitable.
>
> Thanks to everyone who took their time to review the first version.
>
> This patch series applies to commit: f30d294530d9 (mm-new)
>
> Israel Batista (3):
> mm: convert memory block states (MEM_*) macros to enum
> mm: change type of state in struct memory_block
> mm: change type of parameter for memory_notify
>
> drivers/base/memory.c | 6 +++---
> include/linux/memory.h | 28 +++++++++++++++-------------
> 2 files changed, 18 insertions(+), 16 deletions(-)
I wonder if we need three patches for this, but regardless
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> --
> 2.51.0
>
--
Sincerely yours,
Mike.
prev parent reply other threads:[~2025-10-30 14:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-29 19:56 [PATCH v2 0/3] mm: Convert memory block states (MEM_*) macros to Israel Batista
2025-10-29 19:56 ` [PATCH v2 1/3] mm: convert memory block states (MEM_*) macros to enum Israel Batista
2025-10-30 10:52 ` Lorenzo Stoakes
2025-10-30 11:31 ` David Hildenbrand
2025-10-29 19:56 ` [PATCH v2 2/3] mm: change type of state in struct memory_block Israel Batista
2025-10-29 20:59 ` Randy Dunlap
2025-10-30 11:00 ` Lorenzo Stoakes
2025-10-30 11:32 ` David Hildenbrand
2025-10-29 19:56 ` [PATCH v2 3/3] mm: change type of parameter for memory_notify Israel Batista
2025-10-30 10:56 ` Lorenzo Stoakes
2025-10-30 11:16 ` Israel Batista
2025-10-30 11:34 ` David Hildenbrand
2025-10-30 12:00 ` Israel Batista
2025-10-30 14:57 ` Mike Rapoport [this message]
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=aQN83UYU60nVnEcc@kernel.org \
--to=rppt@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linux-debuggers@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@israelbatista.dev.br \
--cc=lorenzo.stoakes@oracle.com \
--cc=osandov@osandov.com \
/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;
as well as URLs for NNTP newsgroup(s).