linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/12] mips: Post-bootmem-memblock transition fixes
@ 2019-04-23 22:47 Serge Semin
  2019-04-23 22:47 ` [PATCH 01/12] mips: Make sure kernel .bss exists in boot mem pool Serge Semin
                   ` (11 more replies)
  0 siblings, 12 replies; 43+ messages in thread
From: Serge Semin @ 2019-04-23 22:47 UTC (permalink / raw)
  To: Ralf Baechle, Paul Burton, James Hogan, Matt Redfearn,
	Mike Rapoport, Andrew Morton, Michal Hocko, Greg Kroah-Hartman,
	Thomas Bogendoerfer, Huacai Chen, Stefan Agner, Stephen Rothwell,
	Alexandre Belloni, Juergen Gross
  Cc: linux-mips, linux-kernel, Serge Semin

First attempt of making the MIPS subsystem utilizing the memblock early memory
allocator was done by me a few years ago. I created a patchset with
21 patches [1]. It turned out to be too complicated and I decided to resend a
reworked patchset with smaller number of changes [2]. I did this and after a
small review process a v2 patchset was also posted. Then my spare
time was over and I couldn't proceed with the patchset support and
resubmission.

In a year Mike Rapoport took charge in this task and posted a small
patch which essentially did the bootmem allocator removal from MIPS
subsystem [3]. A single small patch did in general the whole thing my huge
patchsetes were intended for in the first place (though it lacked a few fixes).
Mike even went further and completely removed the bootmem allocator from
kernel code, so all the subsystems would need to use the only one early
memory allocator. This significantly simplified the platforms code as well
as removed a deprecated subsystem with duplicated functionality. Million
credits to Mike for this.

Getting back to the MIPS subsystem and it memblock allocator usage. Even
though the patch suggested by Mike [3] fixed most of the problems caused
by enabling the memblock allocator usage, some of them have been left
uncovered by it. First of all the PFNs calculation algorithm hasn't been
fully refactored. A reserved memory declaration loop has been left
untouched though it was clearly over-complicated for the new initialization
procedure. Secondly the MIPS platform code reserved the whole space below
kernel start address, which doesn't seem right since kernel can be
located much higher than memory space really starts. Thirdly CMA if it
is enabled reserves memory regions by means of memblock in the first place.
So the bootmem-init code doesn't need to do it again. Fifthly at early
platform initialization stage non of bootmem-left methods can be called
since there is no memory pages mapping at that moment, so __nosave* region
must be reserved by means of memblock allocator. Finally aside from memblock
allocator introduction my early patchsets included a series of useful
alterations like "nomap" property implementation for "reserved-memory"
dts-nodes, memblock_dump_all() method call after early memory allocator
initialization for debugging, low-memory test procedure, kernel memory
mapping printout at boot-time, and so on. So all of these fixes and
alterations are introduced in this new patchset. Please review. Hope
this time I'll be more responsive and finish this series up until it
is merged.

[1] https://lkml.org/lkml/2016/12/18/195
[2] https://lkml.org/lkml/2018/1/17/1201
[3] https://lkml.org/lkml/2018/9/10/302

NOTE I added a few "Reviewed-by:  Matt Redfearn <matt.redfearn@mips.com>"
since some patches of this series have been picked up from my earlier
patchsets, which Matt's already reviewed. I didn't add the tag for patches,
which were either new or partially ported.

Serge Semin (12):
  mips: Make sure kernel .bss exists in boot mem pool
  mips: Discard rudiments from bootmem_init
  mips: Combine memblock init and memory reservation loops
  mips: Reserve memory for the kernel image resources
  mips: Discard post-CMA-init foreach loop
  mips: Use memblock to reserve the __nosave memory range
  mips: Add reserve-nomap memory type support
  mips: Dump memblock regions for debugging
  mips: Perform early low memory test
  mips: Print the kernel virtual mem layout on debugging
  mips: Make sure dt memory regions are valid
  mips: Enable OF_RESERVED_MEM config

 arch/mips/Kconfig                |   1 +
 arch/mips/include/asm/bootinfo.h |   1 +
 arch/mips/kernel/prom.c          |  18 ++++-
 arch/mips/kernel/setup.c         | 129 +++++++++----------------------
 arch/mips/mm/init.c              |  49 ++++++++++++
 5 files changed, 102 insertions(+), 96 deletions(-)

-- 
2.21.0


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

end of thread, other threads:[~2020-10-14  9:49 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-23 22:47 [PATCH 00/12] mips: Post-bootmem-memblock transition fixes Serge Semin
2019-04-23 22:47 ` [PATCH 01/12] mips: Make sure kernel .bss exists in boot mem pool Serge Semin
2019-04-24 22:30   ` Paul Burton
2019-04-23 22:47 ` [PATCH 02/12] mips: Discard rudiments from bootmem_init Serge Semin
2019-04-24 22:30   ` Paul Burton
2019-04-23 22:47 ` [PATCH 03/12] mips: Combine memblock init and memory reservation loops Serge Semin
2019-04-24 22:30   ` Paul Burton
2019-04-23 22:47 ` [PATCH 04/12] mips: Reserve memory for the kernel image resources Serge Semin
2019-04-24 22:43   ` Paul Burton
2019-04-26  0:00     ` Serge Semin
2019-04-30 22:58       ` Paul Burton
2019-05-02 14:24         ` Serge Semin
2019-05-02 18:45           ` Paul Burton
2019-05-03 17:21             ` Serge Semin
2019-05-02 18:35   ` Paul Burton
2019-05-21 14:56   ` Geert Uytterhoeven
2019-05-21 15:53     ` Mike Rapoport
2019-05-21 16:39       ` Serge Semin
2019-05-22  7:50         ` Geert Uytterhoeven
2019-05-22  7:47       ` Geert Uytterhoeven
2019-05-22  8:08         ` Mike Rapoport
2019-05-22  8:14           ` Geert Uytterhoeven
2019-05-22 13:34             ` Serge Semin
2019-05-22 13:44               ` Geert Uytterhoeven
2019-05-22 13:54                 ` Serge Semin
2020-10-14  9:49                   ` Maciej W. Rozycki
2019-04-23 22:47 ` [PATCH 05/12] mips: Discard post-CMA-init foreach loop Serge Semin
2019-05-02 18:35   ` Paul Burton
2019-04-23 22:47 ` [PATCH 06/12] mips: Use memblock to reserve the __nosave memory range Serge Semin
2019-05-02 18:35   ` Paul Burton
2019-04-23 22:47 ` [PATCH 07/12] mips: Add reserve-nomap memory type support Serge Semin
2019-05-02 18:35   ` Paul Burton
2019-04-23 22:47 ` [PATCH 08/12] mips: Dump memblock regions for debugging Serge Semin
2019-04-24 13:45   ` Mike Rapoport
2019-04-24 14:20     ` Serge Semin
2019-04-23 22:47 ` [PATCH 09/12] mips: Perform early low memory test Serge Semin
2019-04-23 22:47 ` [PATCH 10/12] mips: Print the kernel virtual mem layout on debugging Serge Semin
2019-04-24 13:47   ` Mike Rapoport
2019-04-24 14:35     ` Serge Semin
2019-04-23 22:47 ` [PATCH 11/12] mips: Make sure dt memory regions are valid Serge Semin
2019-04-23 22:47 ` [PATCH 12/12] mips: Enable OF_RESERVED_MEM config Serge Semin
2019-04-24  6:17   ` Christoph Hellwig
2019-04-24  8:34     ` Serge Semin

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