Skip to content

Use helper functions to simplify memory intialization code

Jiang Liu linux-arm-kernel linux-mm lkml virtualization xen-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest29 patches 11 repliesIn review
  2. v1 RFC33 patches 12 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/29mm: introduce common help functions to deal with reserved/managed pagesinclude/linux/mm.h mm/page_alloc.c+68 -03 replies
2/29mm/alpha: use common help functions to free reserved pagesarch/alpha/kernel/sys_nautilus.c arch/alpha/mm/init.c arch/alpha/mm/numa.c+6 -260 replies
3/29mm/ARM: use common help functions to free reserved pagesarch/arm/mm/init.c arch/arm64/mm/init.c+18 -562 replies
4/29mm/avr32: use common help functions to free reserved pagesarch/avr32/mm/init.c+2 -220 replies
5/29mm/blackfin: use common help functions to free reserved pagesarch/blackfin/mm/init.c+3 -190 replies
6/29mm/c6x: use common help functions to free reserved pagesarch/c6x/mm/init.c+2 -280 replies
7/29mm/cris: use common help functions to free reserved pagesarch/cris/mm/init.c+2 -140 replies
8/29mm/FRV: use common help functions to free reserved pagesarch/frv/mm/init.c+4 -300 replies
9/29mm/h8300: use common help functions to free reserved pagesarch/h8300/mm/init.c+3 -270 replies
10/29mm/IA64: use common help functions to free reserved pagesarch/ia64/mm/init.c+4 -190 replies
11/29mm/m32r: use common help functions to free reserved pagesarch/m32r/mm/init.c+3 -230 replies
12/29mm/m68k: use common help functions to free reserved pagesarch/m68k/mm/init.c+2 -221 reply
13/29mm/microblaze: use common help functions to free reserved pagesarch/microblaze/include/asm/setup.h arch/microblaze/mm/init.c+2 -270 replies
14/29mm/MIPS: use common help functions to free reserved pagesarch/mips/mm/init.c arch/mips/sgi-ip27/ip27-memory.c+11 -240 replies
15/29mm/mn10300: use common help functions to free reserved pagesarch/mn10300/mm/init.c+2 -210 replies
16/29mm/openrisc: use common help functions to free reserved pagesarch/openrisc/mm/init.c+3 -241 reply
17/29mm/parisc: use common help functions to free reserved pagesarch/parisc/mm/init.c+2 -210 replies
18/29mm/ppc: use common help functions to free reserved pagesarch/powerpc/kernel/crash_dump.c arch/powerpc/kernel/fadump.c arch/powerpc/kernel/kvm.c +2 more+6 -450 replies
19/29mm/s390: use common help functions to free reserved pagesarch/s390/mm/init.c+6 -290 replies
20/29mm/score: use common help functions to free reserved pagesarch/score/mm/init.c+5 -280 replies
21/29mm/SH: use common help functions to free reserved pagesarch/sh/mm/init.c+3 -230 replies
22/29mm/SPARC: use common help functions to free reserved pagesarch/sparc/kernel/leon_smp.c arch/sparc/mm/init_32.c arch/sparc/mm/init_64.c+11 -671 reply
23/29mm/um: use common help functions to free reserved pagesarch/um/kernel/mem.c+1 -90 replies
24/29mm/unicore32: use common help functions to free reserved pagesarch/unicore32/mm/init.c+3 -250 replies
25/29mm/x86: use common help functions to free reserved pagesarch/x86/mm/init.c arch/x86/mm/init_64.c+3 -72 replies
26/29mm/xtensa: use common help functions to free reserved pagesarch/xtensa/mm/init.c+3 -180 replies
27/29mm/arc: use common help functions to free reserved pagesarch/arc/mm/init.c+2 -210 replies
28/29mm/metag: use common help functions to free reserved pagesarch/metag/mm/init.c+2 -190 replies
29/29mm,kexec: use common help functions to free reserved pageskernel/kexec.c+2 -61 reply

Reviews trailers per patch

8 of 29 patches have a Reviewed-by or Acked-by.

PatchHans-Christian EgtvedtPaul MundtDavid S. MillerVineet GuptaSam RavnborgGeert UytterhoevenZhang YanfeiJonas Bonn
1/29A-b A-b
2/29
3/29
4/29A-b
5/29
6/29
7/29
8/29
9/29
10/29
11/29
12/29A-b
13/29
14/29
15/29
16/29A-b
17/29
18/29
19/29
20/29
21/29A-b
22/29A-b A-b
23/29
24/29
25/29
26/29
27/29A-b
28/29
29/29R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 8 reviewers.

Read the v2 thread

Cover letter [PATCH v2, part1 00/29] Use helper functions to simplify memory intialization code

The original goal of this patchset is to fix the bug reported by
https://bugzilla.kernel.org/show_bug.cgi?id=53501
Now it has also been expanded to reduce common code used by memory initializion.

This is the first part, which applies to v3.9-rc1.

It introduces following common helper functions to simplify free_initmem() and free_initrd_mem() on different architectures:
adjust_managed_page_count():

	will be used to adjust totalram_pages, totalhigh_pages,
	zone->managed_pages when reserving/unresering a page.

__free_reserved_page():
free a reserved page into the buddy system without adjusting page statistics info
free_reserved_page():
free a reserved page into the buddy system and adjust page statistics info
mark_page_reserved():
mark a page as reserved and adjust page statistics info
free_reserved_area():
free a continous ranges of pages by calling free_reserved_page()
free_initmem_default():
default method to free __init pages.

We have only tested these patchset on x86 platforms, and have done basic compliation tests using cross-compilers from ftp.kernel.org. That means some code may not pass compilation on some architectures. So any help to test this patchset are welcomed!

There are several other parts still under development:
Part2: introduce free_highmem_page() to simplify freeing highmem pages
Part3: refine code to manage totalram_pages, totalhigh_pages and

	zone->managed_pages

Part4: introduce helper functions to simplify mem_init() and remove the
global variable num_physpages.

Jiang Liu (29):
mm: introduce common help functions to deal with reserved/managed
pages
mm/alpha: use common help functions to free reserved pages mm/ARM: use common help functions to free reserved pages mm/avr32: use common help functions to free reserved pages mm/blackfin: use common help functions to free reserved pages mm/c6x: use common help functions to free reserved pages mm/cris: use common help functions to free reserved pages mm/FRV: use common help functions to free reserved pages mm/h8300: use common help functions to free reserved pages mm/IA64: use common help functions to free reserved pages mm/m32r: use common help functions to free reserved pages mm/m68k: use common help functions to free reserved pages mm/microblaze: use common help functions to free reserved pages mm/MIPS: use common help functions to free reserved pages mm/mn10300: use common help functions to free reserved pages mm/openrisc: use common help functions to free reserved pages mm/parisc: use common help functions to free reserved pages mm/ppc: use common help functions to free reserved pages mm/s390: use common help functions to free reserved pages mm/score: use common help functions to free reserved pages mm/SH: use common help functions to free reserved pages mm/SPARC: use common help functions to free reserved pages mm/um: use common help functions to free reserved pages mm/unicore32: use common help functions to free reserved pages mm/x86: use common help functions to free reserved pages mm/xtensa: use common help functions to free reserved pages mm/arc: use common help functions to free reserved pages mm/metag: use common help functions to free reserved pages mm,kexec: use common help functions to free reserved pages

 arch/alpha/kernel/sys_nautilus.c             |    5 ++-
 arch/alpha/mm/init.c                         |   24 ++-----------
 arch/alpha/mm/numa.c                         |    3 +-
 arch/arc/mm/init.c                           |   23 ++----------
 arch/arm/mm/init.c                           |   48 +++++++++-----------------
 arch/arm64/mm/init.c                         |   26 ++------------
 arch/avr32/mm/init.c                         |   24 ++-----------
 arch/blackfin/mm/init.c                      |   22 ++----------
 arch/c6x/mm/init.c                           |   30 ++--------------
 arch/cris/mm/init.c                          |   16 ++-------
 arch/frv/mm/init.c                           |   34 +++---------------
 arch/h8300/mm/init.c                         |   30 ++--------------
 arch/ia64/mm/init.c                          |   23 +++---------
 arch/m32r/mm/init.c                          |   26 ++------------
 arch/m68k/mm/init.c                          |   24 ++-----------
 arch/metag/mm/init.c                         |   21 ++---------
 arch/microblaze/include/asm/setup.h          |    1 -
 arch/microblaze/mm/init.c                    |   28 ++-------------
 arch/mips/mm/init.c                          |   31 +++++------------
 arch/mips/sgi-ip27/ip27-memory.c             |    4 +--
 arch/mn10300/mm/init.c                       |   23 ++----------
 arch/openrisc/mm/init.c                      |   27 ++-------------
 arch/parisc/mm/init.c                        |   23 ++----------
 arch/powerpc/kernel/crash_dump.c             |    5 +--
 arch/powerpc/kernel/fadump.c                 |    5 +--
 arch/powerpc/kernel/kvm.c                    |    7 +---
 arch/powerpc/mm/mem.c                        |   29 ++--------------
 arch/powerpc/platforms/512x/mpc512x_shared.c |    5 +--
 arch/s390/mm/init.c                          |   35 ++++---------------
 arch/score/mm/init.c                         |   33 +++---------------
 arch/sh/mm/init.c                            |   26 ++------------
 arch/sparc/kernel/leon_smp.c                 |   15 ++------
 arch/sparc/mm/init_32.c                      |   37 ++------------------
 arch/sparc/mm/init_64.c                      |   26 +++-----------
 arch/um/kernel/mem.c                         |   10 +-----
 arch/unicore32/mm/init.c                     |   28 ++-------------
 arch/x86/mm/init.c                           |    5 +--
 arch/x86/mm/init_64.c                        |    5 ++-
 arch/xtensa/mm/init.c                        |   21 ++---------
 include/linux/mm.h                           |   48 ++++++++++++++++++++++++++
 kernel/kexec.c                               |    8 ++---
 mm/page_alloc.c                              |   20 +++++++++++
 42 files changed, 184 insertions(+), 700 deletions(-)
Signature · 7 lines
1.7.9.5

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>