From: Wei Yang <richard.weiyang@gmail.com>
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
Mark Rutland <mark.rutland@arm.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Andrew Morton <akpm@linux-foundation.org>,
Mike Rapoport <rppt@kernel.org>,
linux-mm@kvack.org
Subject: Re: [PATCH v4 1/2] mm/memblock: Add reserved memory release function
Date: Sat, 5 Apr 2025 02:30:18 +0000 [thread overview]
Message-ID: <20250405023018.g2ae52nrz2757b3n@master> (raw)
In-Reply-To: <173989133862.230693.14094993331347437600.stgit@devnote2>
On Wed, Feb 19, 2025 at 12:08:58AM +0900, Masami Hiramatsu (Google) wrote:
>From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
>
>Add reserve_mem_release_by_name() to release a reserved memory region
>with a given name. This allows us to release reserved memory which is
>defined by kernel cmdline, after boot.
>
>Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
>Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
>Cc: Andrew Morton <akpm@linux-foundation.org>
>Cc: linux-mm@kvack.org
>---
> Changes in v4:
> - Use free_reserved_area() according to Mike's comment.
> Changes in v2:
> - Rename reserved_mem_* to reserve_mem_*.
>---
> include/linux/mm.h | 1 +
> mm/memblock.c | 66 +++++++++++++++++++++++++++++++++++++++++++---------
> 2 files changed, 55 insertions(+), 12 deletions(-)
>
>diff --git a/include/linux/mm.h b/include/linux/mm.h
>index 7b1068ddcbb7..1ee9e7447485 100644
>--- a/include/linux/mm.h
>+++ b/include/linux/mm.h
>@@ -4123,6 +4123,7 @@ void vma_pgtable_walk_begin(struct vm_area_struct *vma);
> void vma_pgtable_walk_end(struct vm_area_struct *vma);
>
> int reserve_mem_find_by_name(const char *name, phys_addr_t *start, phys_addr_t *size);
>+int reserve_mem_release_by_name(const char *name);
>
> #ifdef CONFIG_64BIT
> int do_mseal(unsigned long start, size_t len_in, unsigned long flags);
>diff --git a/mm/memblock.c b/mm/memblock.c
>index 95af35fd1389..8cd95f60015d 100644
>--- a/mm/memblock.c
>+++ b/mm/memblock.c
>@@ -16,6 +16,7 @@
> #include <linux/kmemleak.h>
> #include <linux/seq_file.h>
> #include <linux/memblock.h>
>+#include <linux/mutex.h>
>
> #include <asm/sections.h>
> #include <linux/io.h>
>@@ -2283,6 +2284,7 @@ struct reserve_mem_table {
> };
> static struct reserve_mem_table reserved_mem_table[RESERVE_MEM_MAX_ENTRIES];
> static int reserved_mem_count;
>+static DEFINE_MUTEX(reserve_mem_lock);
>
This looks break the memblock tests in tools/testing/memblock.
memblock.c:2289:8: warning: type defaults to ‘int’ in declaration of ‘DEFINE_MUTEX’ [-Wimplicit-int]
2289 | static DEFINE_MUTEX(reserve_mem_lock);
| ^~~~~~~~~~~~
memblock.c:2289:1: warning: parameter names (without types) in function declaration
2289 | static DEFINE_MUTEX(reserve_mem_lock);
| ^~~~~~
memblock.c: In function ‘reserve_mem_find_by_name’:
memblock.c:2332:9: warning: implicit declaration of function ‘guard’ [-Wimplicit-function-declaration]
2332 | guard(mutex)(&reserve_mem_lock);
| ^~~~~
next prev parent reply other threads:[~2025-04-05 2:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-18 15:08 [PATCH v4 0/2] tracing: Make persistent ring buffer freeable Masami Hiramatsu (Google)
2025-02-18 15:08 ` [PATCH v4 1/2] mm/memblock: Add reserved memory release function Masami Hiramatsu (Google)
2025-04-05 2:30 ` Wei Yang [this message]
2025-04-07 0:33 ` Masami Hiramatsu
2025-04-07 1:40 ` Masami Hiramatsu
2025-02-18 15:09 ` [PATCH v4 2/2] tracing: Freeable reserved ring buffer Masami Hiramatsu (Google)
2025-02-25 20:55 ` [PATCH v4 0/2] tracing: Make persistent ring buffer freeable Steven Rostedt
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=20250405023018.g2ae52nrz2757b3n@master \
--to=richard.weiyang@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
--cc=rppt@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