[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1543182277-8819-1-git-send-email-rppt@linux.ibm.com>
Date: Sun, 25 Nov 2018 23:44:32 +0200
From: Mike Rapoport <rppt@...ux.ibm.com>
To: linux-kernel@...r.kernel.org
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Arnd Bergmann <arnd@...db.de>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
"David S. Miller" <davem@...emloft.net>,
Guan Xuetao <gxt@....edu.cn>,
Greentime Hu <green.hu@...il.com>,
Jonas Bonn <jonas@...thpole.se>,
Michael Ellerman <mpe@...erman.id.au>,
Michal Hocko <mhocko@...e.com>,
Michal Simek <monstr@...str.eu>,
Mark Salter <msalter@...hat.com>,
Paul Mackerras <paulus@...ba.org>,
Rich Felker <dalias@...c.org>,
Russell King <linux@...linux.org.uk>,
Stefan Kristiansson <stefan.kristiansson@...nalahti.fi>,
Stafford Horne <shorne@...il.com>,
Vincent Chen <deanbo422@...il.com>,
Yoshinori Sato <ysato@...rs.sourceforge.jp>,
linux-arm-kernel@...ts.infradead.org, linux-c6x-dev@...ux-c6x.org,
linux-mm@...ck.org, linux-sh@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, openrisc@...ts.librecores.org,
sparclinux@...r.kernel.org, Mike Rapoport <rppt@...ux.ibm.com>
Subject: [PATCH 0/5] memblock: simplify several early memory allocations
Hi,
These patches simplify some of the early memory allocations by replacing
usage of older memblock APIs with newer and shinier ones.
Quite a few places in the arch/ code allocated memory using a memblock API
that returns a physical address of the allocated area, then converted this
physical address to a virtual one and then used memset(0) to clear the
allocated range.
More recent memblock APIs do all the three steps in one call and their
usage simplifies the code.
It's important to note that regardless of API used, the core allocation is
nearly identical for any set of memblock allocators: first it tries to find
a free memory with all the constraints specified by the caller and then
falls back to the allocation with some or all constraints disabled.
The first three patches perform the conversion of call sites that have
exact requirements for the node and the possible memory range.
The fourth patch is a bit one-off as it simplifies openrisc's
implementation of pte_alloc_one_kernel(), and not only the memblock usage.
The fifth patch takes care of simpler cases when the allocation can be
satisfied with a simple call to memblock_alloc().
Mike Rapoport (5):
powerpc: prefer memblock APIs returning virtual address
microblaze: prefer memblock API returning virtual address
sh: prefer memblock APIs returning virtual address
openrisc: simplify pte_alloc_one_kernel()
arch: simplify several early memory allocations
arch/arm/mm/mmu.c | 4 +---
arch/c6x/mm/dma-coherent.c | 9 ++-------
arch/microblaze/mm/init.c | 5 +++--
arch/nds32/mm/init.c | 12 ++++--------
arch/openrisc/mm/ioremap.c | 11 ++++-------
arch/powerpc/kernel/paca.c | 14 ++++++--------
arch/powerpc/kernel/setup-common.c | 4 ++--
arch/powerpc/kernel/setup_64.c | 21 ++++++++++-----------
arch/powerpc/mm/hash_utils_64.c | 6 +++---
arch/powerpc/mm/pgtable-book3e.c | 8 ++------
arch/powerpc/mm/pgtable-book3s64.c | 5 +----
arch/powerpc/mm/pgtable-radix.c | 24 +++++++++---------------
arch/powerpc/mm/pgtable_32.c | 4 +---
arch/powerpc/mm/ppc_mmu_32.c | 3 +--
arch/powerpc/platforms/pasemi/iommu.c | 5 +++--
arch/powerpc/platforms/powernv/opal.c | 3 +--
arch/powerpc/platforms/pseries/setup.c | 11 +++++++----
arch/powerpc/sysdev/dart_iommu.c | 5 +++--
arch/sh/mm/init.c | 18 +++++-------------
arch/sh/mm/numa.c | 5 ++---
arch/sparc/kernel/prom_64.c | 7 ++-----
arch/sparc/mm/init_64.c | 9 +++------
arch/unicore32/mm/mmu.c | 4 +---
23 files changed, 76 insertions(+), 121 deletions(-)
--
2.7.4
Powered by blists - more mailing lists