All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] memblock: simplify several early memory allocation
@ 2018-12-03 15:47 ` Mike Rapoport
  0 siblings, 0 replies; 106+ messages in thread
From: Mike Rapoport @ 2018-12-03 15:47 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Michal Hocko, linux-sh, Benjamin Herrenschmidt, linux-mm,
	Rich Felker, Paul Mackerras, sparclinux, Vincent Chen,
	Jonas Bonn, linux-c6x-dev, Yoshinori Sato, Michael Ellerman,
	Russell King, Mike Rapoport, Mark Salter, Arnd Bergmann,
	Stefan Kristiansson, openrisc, Greentime Hu, Stafford Horne,
	Guan Xuetao, linux-arm-kernel, Michal Simek, linux-kernel,
	linuxppc-dev, David S. Miller

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().

The sixth patch removes one-liner wrappers for memblock_alloc on arm and
unicore32, as suggested by Christoph.

v2:
* added Ack from Stafford Horne for openrisc changes
* entirely drop early_alloc wrappers on arm and unicore32, as per Christoph
Hellwig

Mike Rapoport (6):
  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
  arm, unicore32: remove early_alloc*() wrappers

 arch/arm/mm/mmu.c                      | 13 +++----------
 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                | 14 ++++----------
 23 files changed, 81 insertions(+), 135 deletions(-)

^ permalink raw reply	[flat|nested] 106+ messages in thread

end of thread, other threads:[~2018-12-06 21:36 UTC | newest]

Thread overview: 106+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-03 15:47 [PATCH v2 0/6] memblock: simplify several early memory allocation Mike Rapoport
2018-12-03 15:47 ` [OpenRISC] " Mike Rapoport
2018-12-03 15:47 ` Mike Rapoport
2018-12-03 15:47 ` Mike Rapoport
2018-12-03 15:47 ` Mike Rapoport
2018-12-03 15:47 ` [PATCH v2 1/6] powerpc: prefer memblock APIs returning virtual address Mike Rapoport
2018-12-03 15:47   ` [OpenRISC] " Mike Rapoport
2018-12-03 15:47   ` Mike Rapoport
2018-12-03 15:47   ` Mike Rapoport
2018-12-03 15:47   ` Mike Rapoport
2018-12-04  9:59   ` Michael Ellerman
2018-12-04  9:59     ` [OpenRISC] " Michael Ellerman
2018-12-04  9:59     ` Michael Ellerman
2018-12-04  9:59     ` Michael Ellerman
2018-12-04  9:59     ` Michael Ellerman
2018-12-04  9:59     ` Michael Ellerman
2018-12-04 17:13     ` Mike Rapoport
2018-12-04 17:13       ` [OpenRISC] " Mike Rapoport
2018-12-04 17:13       ` Mike Rapoport
2018-12-04 17:13       ` Mike Rapoport
2018-12-04 17:13       ` Mike Rapoport
2018-12-05 12:37       ` Michael Ellerman
2018-12-05 12:37         ` [OpenRISC] " Michael Ellerman
2018-12-05 12:37         ` Michael Ellerman
2018-12-05 12:37         ` Michael Ellerman
2018-12-05 12:37         ` Michael Ellerman
2018-12-05 21:22         ` Mike Rapoport
2018-12-05 21:22           ` [OpenRISC] " Mike Rapoport
2018-12-05 21:22           ` Mike Rapoport
2018-12-05 21:22           ` Mike Rapoport
2018-12-05 21:22           ` Mike Rapoport
2018-12-03 15:47 ` [PATCH v2 2/6] microblaze: prefer memblock API " Mike Rapoport
2018-12-03 15:47   ` [OpenRISC] " Mike Rapoport
2018-12-03 15:47   ` Mike Rapoport
2018-12-03 15:47   ` Mike Rapoport
2018-12-03 15:47   ` Mike Rapoport
2018-12-05 15:29   ` Michal Simek
2018-12-05 15:29     ` [OpenRISC] " Michal Simek
2018-12-05 15:29     ` Michal Simek
2018-12-05 15:29     ` Michal Simek
2018-12-05 15:29     ` Michal Simek
2018-12-06  7:31     ` Mike Rapoport
2018-12-06  7:31       ` [OpenRISC] " Mike Rapoport
2018-12-06  7:31       ` Mike Rapoport
2018-12-06  7:31       ` Mike Rapoport
2018-12-06  7:31       ` Mike Rapoport
2018-12-03 15:47 ` [PATCH v2 3/6] sh: prefer memblock APIs " Mike Rapoport
2018-12-03 15:47   ` [OpenRISC] " Mike Rapoport
2018-12-03 15:47   ` Mike Rapoport
2018-12-03 15:47   ` Mike Rapoport
2018-12-03 15:47   ` Mike Rapoport
2018-12-03 16:10   ` Sam Ravnborg
2018-12-03 16:10     ` [OpenRISC] " Sam Ravnborg
2018-12-03 16:10     ` Sam Ravnborg
2018-12-03 16:10     ` Sam Ravnborg
2018-12-03 16:10     ` Sam Ravnborg
2018-12-03 16:28     ` Mike Rapoport
2018-12-03 16:28       ` [OpenRISC] " Mike Rapoport
2018-12-03 16:28       ` Mike Rapoport
2018-12-03 16:28       ` Mike Rapoport
2018-12-03 16:28       ` Mike Rapoport
2018-12-03 15:47 ` [PATCH v2 4/6] openrisc: simplify pte_alloc_one_kernel() Mike Rapoport
2018-12-03 15:47   ` [OpenRISC] " Mike Rapoport
2018-12-03 15:47   ` Mike Rapoport
2018-12-03 15:47   ` Mike Rapoport
2018-12-03 15:47   ` Mike Rapoport
2018-12-03 15:47 ` [PATCH v2 5/6] arch: simplify several early memory allocations Mike Rapoport
2018-12-03 15:47   ` [OpenRISC] " Mike Rapoport
2018-12-03 15:47   ` Mike Rapoport
2018-12-03 15:47   ` Mike Rapoport
2018-12-03 15:47   ` Mike Rapoport
2018-12-03 16:29   ` Sam Ravnborg
2018-12-03 16:29     ` [OpenRISC] " Sam Ravnborg
2018-12-03 16:29     ` Sam Ravnborg
2018-12-03 16:29     ` Sam Ravnborg
2018-12-03 16:29     ` Sam Ravnborg
2018-12-03 16:49     ` Mike Rapoport
2018-12-03 16:49       ` [OpenRISC] " Mike Rapoport
2018-12-03 16:49       ` Mike Rapoport
2018-12-03 16:49       ` Mike Rapoport
2018-12-03 16:49       ` Mike Rapoport
2018-12-06 18:08       ` Sam Ravnborg
2018-12-06 18:08         ` [OpenRISC] " Sam Ravnborg
2018-12-06 18:08         ` Sam Ravnborg
2018-12-06 18:08         ` Sam Ravnborg
2018-12-06 18:08         ` Sam Ravnborg
2018-12-06 21:30         ` Mike Rapoport
2018-12-06 21:30           ` [OpenRISC] " Mike Rapoport
2018-12-06 21:30           ` Mike Rapoport
2018-12-06 21:30           ` Mike Rapoport
2018-12-06 21:30           ` Mike Rapoport
2018-12-03 15:47 ` [PATCH v2 6/6] arm, unicore32: remove early_alloc*() wrappers Mike Rapoport
2018-12-03 15:47   ` [OpenRISC] " Mike Rapoport
2018-12-03 15:47   ` Mike Rapoport
2018-12-03 15:47   ` Mike Rapoport
2018-12-03 15:47   ` Mike Rapoport
2018-12-03 16:27   ` Rob Herring
2018-12-03 16:27     ` [OpenRISC] " Rob Herring
2018-12-03 16:27     ` Rob Herring
2018-12-03 16:27     ` Rob Herring
2018-12-03 16:27     ` Rob Herring
2018-12-03 16:55     ` Mike Rapoport
2018-12-03 16:55       ` [OpenRISC] " Mike Rapoport
2018-12-03 16:55       ` Mike Rapoport
2018-12-03 16:55       ` Mike Rapoport
2018-12-03 16:55       ` Mike Rapoport

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.