From: Mike Rapoport <rppt@linux.vnet.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Richard Kuo <rkuo@codeaurora.org>,
Ley Foon Tan <lftan@altera.com>,
Richard Weinberger <richard@nod.at>, Guan Xuetao <gxt@pku.edu.cn>,
Michal Hocko <mhocko@kernel.org>,
linux-hexagon@vger.kernel.org, nios2-dev@lists.rocketboards.org,
linux-um@lists.infradead.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org,
Mike Rapoport <rppt@linux.vnet.ibm.com>
Subject: [PATCH 7/7] unicore32: switch to NO_BOOTMEM
Date: Fri, 3 Aug 2018 22:58:50 +0300 [thread overview]
Message-ID: <1533326330-31677-8-git-send-email-rppt@linux.vnet.ibm.com> (raw)
In-Reply-To: <1533326330-31677-1-git-send-email-rppt@linux.vnet.ibm.com>
The unicore32 already supports memblock and uses it for some early memory
reservations, e.g initrd and the page tables.
At some point unicore32 allocates the bootmem bitmap from the memblock and
then hands over the memory reservations from memblock to bootmem.
This patch removes the bootmem initialization and leaves memblock as the
only boot time memory manager for unicore32.
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Acked-by: Guan Xuetao <gxt@pku.edu.cn>
---
arch/unicore32/Kconfig | 1 +
arch/unicore32/mm/init.c | 54 +-----------------------------------------------
2 files changed, 2 insertions(+), 53 deletions(-)
diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index 03f991e..cff4b9d 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -5,6 +5,7 @@ config UNICORE32
select ARCH_MIGHT_HAVE_PC_PARPORT
select ARCH_MIGHT_HAVE_PC_SERIO
select HAVE_MEMBLOCK
+ select NO_BOOTMEM
select HAVE_GENERIC_DMA_COHERENT
select HAVE_KERNEL_GZIP
select HAVE_KERNEL_BZIP2
diff --git a/arch/unicore32/mm/init.c b/arch/unicore32/mm/init.c
index f4950fb..44ccc15 100644
--- a/arch/unicore32/mm/init.c
+++ b/arch/unicore32/mm/init.c
@@ -84,58 +84,6 @@ static void __init find_limits(unsigned long *min, unsigned long *max_low,
}
}
-static void __init uc32_bootmem_init(unsigned long start_pfn,
- unsigned long end_pfn)
-{
- struct memblock_region *reg;
- unsigned int boot_pages;
- phys_addr_t bitmap;
- pg_data_t *pgdat;
-
- /*
- * Allocate the bootmem bitmap page. This must be in a region
- * of memory which has already been mapped.
- */
- boot_pages = bootmem_bootmap_pages(end_pfn - start_pfn);
- bitmap = memblock_alloc_base(boot_pages << PAGE_SHIFT, L1_CACHE_BYTES,
- __pfn_to_phys(end_pfn));
-
- /*
- * Initialise the bootmem allocator, handing the
- * memory banks over to bootmem.
- */
- node_set_online(0);
- pgdat = NODE_DATA(0);
- init_bootmem_node(pgdat, __phys_to_pfn(bitmap), start_pfn, end_pfn);
-
- /* Free the lowmem regions from memblock into bootmem. */
- for_each_memblock(memory, reg) {
- unsigned long start = memblock_region_memory_base_pfn(reg);
- unsigned long end = memblock_region_memory_end_pfn(reg);
-
- if (end >= end_pfn)
- end = end_pfn;
- if (start >= end)
- break;
-
- free_bootmem(__pfn_to_phys(start), (end - start) << PAGE_SHIFT);
- }
-
- /* Reserve the lowmem memblock reserved regions in bootmem. */
- for_each_memblock(reserved, reg) {
- unsigned long start = memblock_region_reserved_base_pfn(reg);
- unsigned long end = memblock_region_reserved_end_pfn(reg);
-
- if (end >= end_pfn)
- end = end_pfn;
- if (start >= end)
- break;
-
- reserve_bootmem(__pfn_to_phys(start),
- (end - start) << PAGE_SHIFT, BOOTMEM_DEFAULT);
- }
-}
-
static void __init uc32_bootmem_free(unsigned long min, unsigned long max_low,
unsigned long max_high)
{
@@ -232,7 +180,7 @@ void __init bootmem_init(void)
find_limits(&min, &max_low, &max_high);
- uc32_bootmem_init(min, max_low);
+ node_set_online(0);
#ifdef CONFIG_SWIOTLB
swiotlb_init(1);
--
2.7.4
next prev parent reply other threads:[~2018-08-03 19:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-03 19:58 [PATCH RESEND 0/7] switch several architectures NO_BOOTMEM Mike Rapoport
2018-08-03 19:58 ` [PATCH 1/7] hexagon: switch to NO_BOOTMEM Mike Rapoport
2018-08-03 19:58 ` [PATCH 2/7] of: ignore sub-page memory regions Mike Rapoport
2018-08-03 19:58 ` [PATCH 3/7] nios2: use generic early_init_dt_add_memory_arch Mike Rapoport
2018-08-03 19:58 ` [PATCH 4/7] nios2: switch to NO_BOOTMEM Mike Rapoport
2018-08-03 19:58 ` [PATCH 5/7] um: setup_physmem: stop using global variables Mike Rapoport
2018-08-03 19:58 ` [PATCH 6/7] um: switch to NO_BOOTMEM Mike Rapoport
2018-08-03 19:58 ` Mike Rapoport [this message]
2018-08-29 7:20 ` [PATCH RESEND 0/7] switch several architectures NO_BOOTMEM 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=1533326330-31677-8-git-send-email-rppt@linux.vnet.ibm.com \
--to=rppt@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=gxt@pku.edu.cn \
--cc=lftan@altera.com \
--cc=linux-hexagon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-um@lists.infradead.org \
--cc=mhocko@kernel.org \
--cc=nios2-dev@lists.rocketboards.org \
--cc=richard@nod.at \
--cc=rkuo@codeaurora.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;
as well as URLs for NNTP newsgroup(s).