Skip to content

mm: move core MM initialization to mm/mm_init.c

Mike Rapoport linux-mips linux-mm lkml 3 versions – Applied

Status from this message: [merged mm-stable] maintainers-extend-memblock-entry-to-include-mm-initialization.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest posting 2/214 patches 21 repliesApplied 14/14
  2. v2 posting 1/22 of 14 patches 2 repliesSuperseded
  3. v115 patches 20 repliesSuperseded

Changes in v2 from the cover letter

* move init_cma_reserved_pageblock() from cma.c to mm_init.c
* rename init_mem_debugging_and_hardening() to mem_debugging_and_hardening_init()
* inline pgtable_init() into mem_core_init()
* add Acked and Reviewed tags (thanks David, hopefully I've picked them right)

Patches in v2 posting 2/2 All 14 applied

#Subject and filesSizeRepliesApplied
1/14mips: fix comment about pgtable_init()arch/mips/include/asm/fixmap.h+1 -11 replyApplied
2/14mm/page_alloc: add helper for checking if check_pages_enabledmm/page_alloc.c+8 -31 replyApplied
3/14mm: move most of core MM initialization to mm/mm_init.cinclude/linux/gfp.h mm/cma.c mm/internal.h +2 more+2614 -26001 replyApplied
4/14mm: handle hashdist initialization in mm/mm_init.cmm/mm_init.c mm/page_alloc.c+22 -182 repliesApplied
5/14mm/page_alloc: rename page_alloc_init() to page_alloc_init_cpuhp()include/linux/gfp.h init/main.c mm/page_alloc.c+3 -31 replyApplied
6/14init: fold build_all_zonelists() and page_alloc_init_cpuhp() to mm_init()init/main.c+4 -33 repliesApplied
7/14init,mm: move mm_init() to mm/mm_init.c and rename it to mm_core_init()include/linux/mm.h init/main.c mm/mm_init.c+76 -691 replyApplied
8/14mm: call {ptlock,pgtable}_cache_init() directly from mm_core_init()include/linux/mm.h mm/mm_init.c+2 -74 repliesApplied
9/14mm: move init_mem_debugging_and_hardening() to mm/mm_init.cinclude/linux/mm.h mm/internal.h mm/mm_init.c +1 more+98 -971 replyApplied
10/14init,mm: fold late call to page_ext_init() to page_alloc_init_late()include/linux/page_ext.h init/main.c mm/mm_init.c+5 -71 replyApplied
11/14mm: move mem_init_print_info() to mm_init.cinclude/linux/mm.h mm/internal.h mm/mm_init.c +1 more+54 -541 replyApplied
12/14mm: move kmem_cache_init() declaration to mm/slab.hinclude/linux/slab.h mm/mm_init.c mm/slab.h+2 -11 replyApplied
13/14mm: move vmalloc_init() declaration to mm/internal.hinclude/linux/vmalloc.h mm/internal.h+5 -41 replyApplied
14/14MAINTAINERS: extend memblock entry to include MM initializationMAINTAINERS+2 -11 replyApplied

Reviews trailers per patch

All 14 patches have a Reviewed-by or Acked-by.

PatchDavid HildenbrandVlastimil Babka
1/14R-b R-b
2/14R-b R-b
3/14A-b A-b
4/14A-b R-b
5/14R-b R-b
6/14A-b R-b
7/14A-b R-b
8/14R-b R-b
9/14A-b R-b
10/14R-b R-b
11/14A-b R-b
12/14R-b R-b
13/14R-b R-b
14/14R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/14] mm: move core MM initialization to mm/mm_init.c

From: "Mike Rapoport (IBM)" <[email protected]>

Also in git:
https://git.kernel.org/rppt/h/mm-init/v2

v2:
* move init_cma_reserved_pageblock() from cma.c to mm_init.c
* rename init_mem_debugging_and_hardening() to mem_debugging_and_hardening_init()
* inline pgtable_init() into mem_core_init()
* add Acked and Reviewed tags (thanks David, hopefully I've picked them right)

v1: https://lore.kernel.org/all/[email protected]
This set moves most of the core MM initialization to mm/mm_init.c.

This largely includes free_area_init() and its helpers, functions used at boot time, mm_init() from init/main.c and some of the functions it calls.

Aside from gaining some more space before mm/page_alloc.c hits 10k lines, this makes mm/page_alloc.c to be mostly about buddy allocator and moves the init code out of the way, which IMO improves maintainability.

Besides, this allows to move a couple of declarations out of include/linux and make them private to mm/.

And as an added bonus there a slight decrease in vmlinux size. For tinyconfig and defconfig on x86 I've got

tinyconfig:
text data bss dec hex filename
853206 289376 1200128 2342710 23bf36 a/vmlinux
853198 289344 1200128 2342670 23bf0e b/vmlinux

defconfig:
text data bss dec hex filename
26152959 9730634 2170884 38054477 244aa4d a/vmlinux
26152945 9730602 2170884 38054431 244aa1f b/vmlinux

Mike Rapoport (IBM) (14):
mips: fix comment about pgtable_init()
mm/page_alloc: add helper for checking if check_pages_enabled
mm: move most of core MM initialization to mm/mm_init.c
mm: handle hashdist initialization in mm/mm_init.c mm/page_alloc: rename page_alloc_init() to page_alloc_init_cpuhp()
init: fold build_all_zonelists() and page_alloc_init_cpuhp() to mm_init() init,mm: move mm_init() to mm/mm_init.c and rename it to mm_core_init()
mm: call {ptlock,pgtable}_cache_init() directly from mm_core_init()
mm: move init_mem_debugging_and_hardening() to mm/mm_init.c init,mm: fold late call to page_ext_init() to page_alloc_init_late()
mm: move mem_init_print_info() to mm_init.c
mm: move kmem_cache_init() declaration to mm/slab.h
mm: move vmalloc_init() declaration to mm/internal.h
MAINTAINERS: extend memblock entry to include MM initialization

 MAINTAINERS                    |    3 +-
 arch/mips/include/asm/fixmap.h |    2 +-
 include/linux/gfp.h            |    7 +-
 include/linux/mm.h             |    9 +-
 include/linux/page_ext.h       |    2 -
 include/linux/slab.h           |    1 -
 include/linux/vmalloc.h        |    4 -
 init/main.c                    |   74 +-
 mm/cma.c                       |    1 +
 mm/internal.h                  |   52 +-
 mm/mm_init.c                   | 2547 +++++++++++++++++++++++++++
 mm/page_alloc.c                | 2981 +++-----------------------------
 mm/slab.h                      |    1 +
 13 files changed, 2856 insertions(+), 2828 deletions(-)

base-commit: 4018ab1f7cec061b8425737328edefebdc0ab832

Signature · 1 line
2.35.1