From: Tiezhu Yang <yangtiezhu@loongson.cn>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Mike Rapoport <rppt@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Xuefeng Li <lixuefeng@loongson.cn>,
linux-mips@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v4 2/4] memblock: Introduce memblock_mem_range_remove_map()
Date: Tue, 1 Mar 2022 12:28:59 +0800 [thread overview]
Message-ID: <1646108941-27919-3-git-send-email-yangtiezhu@loongson.cn> (raw)
In-Reply-To: <1646108941-27919-1-git-send-email-yangtiezhu@loongson.cn>
This is preparation for supporting memmap=limit@base parameter,
no functionality change.
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
include/linux/memblock.h | 1 +
mm/memblock.c | 9 +++++++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 50ad196..e558d2c 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -482,6 +482,7 @@ phys_addr_t memblock_end_of_DRAM(void);
void memblock_enforce_memory_limit(phys_addr_t memory_limit);
void memblock_cap_memory_range(phys_addr_t base, phys_addr_t size);
void memblock_mem_limit_remove_map(phys_addr_t limit);
+void memblock_mem_range_remove_map(phys_addr_t base, phys_addr_t limit);
bool memblock_is_memory(phys_addr_t addr);
bool memblock_is_map_memory(phys_addr_t addr);
bool memblock_is_region_memory(phys_addr_t base, phys_addr_t size);
diff --git a/mm/memblock.c b/mm/memblock.c
index 1018e50..2476d15d 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -1723,7 +1723,7 @@ void __init memblock_cap_memory_range(phys_addr_t base, phys_addr_t size)
base + size, PHYS_ADDR_MAX);
}
-void __init memblock_mem_limit_remove_map(phys_addr_t limit)
+void __init memblock_mem_range_remove_map(phys_addr_t base, phys_addr_t limit)
{
phys_addr_t max_addr;
@@ -1736,7 +1736,12 @@ void __init memblock_mem_limit_remove_map(phys_addr_t limit)
if (max_addr == PHYS_ADDR_MAX)
return;
- memblock_cap_memory_range(0, max_addr);
+ memblock_cap_memory_range(base, max_addr);
+}
+
+void __init memblock_mem_limit_remove_map(phys_addr_t limit)
+{
+ memblock_mem_range_remove_map(0, limit);
}
static int __init_memblock memblock_search(struct memblock_type *type, phys_addr_t addr)
--
2.1.0
next prev parent reply other threads:[~2022-03-01 4:29 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-01 4:28 [PATCH v4 0/4] MIPS: Modify mem= and memmap= parameter Tiezhu Yang
2022-03-01 4:28 ` [PATCH v4 1/4] MIPS: Refactor early_parse_mem() to fix mem= parameter Tiezhu Yang
2022-03-04 15:10 ` Thomas Bogendoerfer
2022-03-04 15:35 ` Thomas Bogendoerfer
2022-03-04 17:11 ` Maciej W. Rozycki
2022-03-05 13:13 ` Mike Rapoport
2022-03-07 16:29 ` Thomas Bogendoerfer
2022-03-07 22:07 ` Mike Rapoport
2022-03-07 23:09 ` Maciej W. Rozycki
2022-03-01 4:28 ` Tiezhu Yang [this message]
2022-03-01 4:29 ` [PATCH v4 3/4] MIPS: Refactor early_parse_memmap() to fix memmap= parameter Tiezhu Yang
2022-03-01 4:29 ` [PATCH v4 4/4] MIPS: Remove not used variable usermem Tiezhu Yang
2022-03-01 9:55 ` [PATCH v4 0/4] MIPS: Modify mem= and memmap= parameter Mike Rapoport
2022-03-01 11:51 ` Tiezhu Yang
2022-03-01 14:31 ` Mike Rapoport
2022-03-02 1:50 ` Tiezhu Yang
2022-03-02 8:03 ` Mike Rapoport
2022-03-02 9:28 ` Tiezhu Yang
2022-03-02 12:50 ` Mike Rapoport
2022-03-04 17:05 ` Maciej W. Rozycki
2022-03-05 6:19 ` Tiezhu Yang
2022-03-05 13:26 ` Mike Rapoport
2022-03-05 19:21 ` Maciej W. Rozycki
2022-03-05 20:09 ` Mike Rapoport
2022-03-06 1:22 ` Maciej W. Rozycki
2022-03-05 20:53 ` Maciej W. Rozycki
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=1646108941-27919-3-git-send-email-yangtiezhu@loongson.cn \
--to=yangtiezhu@loongson.cn \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lixuefeng@loongson.cn \
--cc=rppt@kernel.org \
--cc=tsbogend@alpha.franken.de \
/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