From: Jiang Liu <liuj97@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
David Rientjes <rientjes@google.com>
Cc: Jiang Liu <jiang.liu@huawei.com>,
Wen Congyang <wency@cn.fujitsu.com>, Mel Gorman <mgorman@suse.de>,
Minchan Kim <minchan@kernel.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Michal Hocko <mhocko@suse.cz>, Jianguo Wu <wujianguo@huawei.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [RFC PATCH v2, part4 00/39] Simplify mem_init() implementations and kill num_physpages
Date: Sun, 24 Mar 2013 15:24:26 +0800 [thread overview]
Message-ID: <1364109934-7851-1-git-send-email-jiang.liu@huawei.com> (raw)
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 last part, previous three patch sets could be accessed at:
http://marc.info/?l=linux-mm&m=136289696323825&w=2
http://marc.info/?l=linux-mm&m=136290291524901&w=2
http://marc.info/?l=linux-mm&m=136345342831592&w=2
This patchset applies to
https://git.kernel.org/pub/scm/linux/kernel/git/mhocko/mm.git since-3.8
Patch 1-7:
1) add comments for global variables exported by vmlinux.lds
2) normalize global variables exported by vmlinux.lds
Patch 8:
Introduce helper functions mem_init_print_info() and
get_num_physpages()
Patch 9:
Avoid using num_physpages at runtime
Patch 10-38:
1) Simplify mem_init() by using mem_init_print_info()
2) Prepare fore kill global variable num_physpages
Patch 39:
Kill global variable num_physpages
With all patches applied, mem_init(), free_initmem(), free_initrd_mem()
could be as simple as below. This patch series has reduced about 1.2K
lines of code in total.
#ifndef CONFIG_DISCONTIGMEM
void __init
mem_init(void)
{
max_mapnr = max_low_pfn;
free_all_bootmem();
high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
mem_init_print_info(NULL);
}
#endif /* CONFIG_DISCONTIGMEM */
void
free_initmem(void)
{
free_initmem_default(-1);
}
#ifdef CONFIG_BLK_DEV_INITRD
void
free_initrd_mem(unsigned long start, unsigned long end)
{
free_reserved_area(start, end, -1, "initrd");
}
#endif
Due to hardware resource limitations, I have only tested this on x86_64.
And the messages reported are:
Previous log message:
Memory: 7745676k/8910848k available (6934k kernel code, 836024k absent, 329148k reserved, 6343k data, 1012k init)
Current log message:
Memory: 7744624K/8074824K available (6969K kernel code, 1011K data, 2828K rodata, 1016K init, 9640K bss, 330200K reserved)
Any help to review or test these patch series are welcomed!
Jiang Liu (39):
vmlinux.lds: add comments for global variables and clean up useless
declarations
avr32: normalize global variables exported by vmlinux.lds
c6x: normalize global variables exported by vmlinux.lds
h8300: normalize global variables exported by vmlinux.lds
score: normalize global variables exported by vmlinux.lds
tile: normalize global variables exported by vmlinux.lds
UML: normalize global variables exported by vmlinux.lds
mm: introduce helper function mem_init_print_info() to simplify
mem_init()
mm: use totalram_pages instead of num_physpages at runtime
mm/alpha: prepare for removing num_physpages and simplify mem_init()
mm/ARM: prepare for removing num_physpages and simplify mem_init()
mm/ARM64: prepare for removing num_physpages and simplify mem_init()
mm/AVR32: prepare for removing num_physpages and simplify mem_init()
mm/blackfin: prepare for removing num_physpages and simplify
mem_init()
mm/c6x: prepare for removing num_physpages and simplify mem_init()
mm/cris: prepare for removing num_physpages and simplify mem_init()
mm/frv: prepare for removing num_physpages and simplify mem_init()
mm/h8300: prepare for removing num_physpages and simplify mem_init()
mm/hexagon: prepare for removing num_physpages and simplify
mem_init()
mm/IA64: prepare for removing num_physpages and simplify mem_init()
mm/m32r: prepare for removing num_physpages and simplify mem_init()
mm/m68k: prepare for removing num_physpages and simplify mem_init()
mm/microblaze: prepare for removing num_physpages and simplify
mem_init()
mm/MIPS: prepare for removing num_physpages and simplify mem_init()
mm/mn10300: prepare for removing num_physpages and simplify
mem_init()
mm/openrisc: prepare for removing num_physpages and simplify
mem_init()
mm/PARISC: prepare for removing num_physpages and simplify mem_init()
mm/ppc: prepare for removing num_physpages and simplify mem_init()
mm/s390: prepare for removing num_physpages and simplify mem_init()
mm/score: prepare for removing num_physpages and simplify mem_init()
mm/SH: prepare for removing num_physpages and simplify mem_init()
mm/SPARC: prepare for removing num_physpages and simplify mem_init()
mm/tile: prepare for removing num_physpages and simplify mem_init()
mm/um: prepare for removing num_physpages and simplify mem_init()
mm/unicore32: prepare for removing num_physpages and simplify
mem_init()
mm/x86: prepare for removing num_physpages and simplify mem_init()
mm/xtensa: prepare for removing num_physpages and simplify mem_init()
mm/hotplug: prepare for removing num_physpages
mm: kill global variable num_physpages
arch/alpha/mm/init.c | 32 ++-------------------
arch/alpha/mm/numa.c | 34 ++++------------------
arch/arm/mm/init.c | 47 ++----------------------------
arch/arm64/mm/init.c | 48 ++-----------------------------
arch/avr32/kernel/setup.c | 2 +-
arch/avr32/kernel/vmlinux.lds.S | 4 +--
arch/avr32/mm/init.c | 29 +++----------------
arch/blackfin/mm/init.c | 38 ++++---------------------
arch/c6x/kernel/vmlinux.lds.S | 4 +--
arch/c6x/mm/init.c | 11 +------
arch/cris/mm/init.c | 33 ++-------------------
arch/frv/kernel/setup.c | 14 ++++-----
arch/frv/mm/init.c | 49 +++++++++----------------------
arch/h8300/boot/compressed/misc.c | 1 -
arch/h8300/kernel/vmlinux.lds.S | 2 ++
arch/h8300/mm/init.c | 34 ++++++----------------
arch/hexagon/mm/init.c | 3 +-
arch/ia64/mm/contig.c | 11 -------
arch/ia64/mm/discontig.c | 3 --
arch/ia64/mm/init.c | 27 +-----------------
arch/m32r/mm/discontig.c | 6 +---
arch/m32r/mm/init.c | 49 ++++---------------------------
arch/m68k/mm/init.c | 31 ++------------------
arch/microblaze/mm/init.c | 51 ++++-----------------------------
arch/mips/mm/init.c | 57 ++++++++++++-------------------------
arch/mips/pci/pci-lantiq.c | 2 +-
arch/mips/sgi-ip27/ip27-memory.c | 21 ++------------
arch/mn10300/mm/init.c | 26 ++---------------
arch/openrisc/mm/init.c | 44 +++-------------------------
arch/parisc/mm/init.c | 46 ++----------------------------
arch/powerpc/mm/mem.c | 56 ++++++++----------------------------
arch/s390/mm/init.c | 17 ++---------
arch/score/kernel/vmlinux.lds.S | 1 +
arch/score/mm/init.c | 26 ++---------------
arch/sh/mm/init.c | 25 +++-------------
arch/sparc/kernel/leon_smp.c | 3 --
arch/sparc/mm/init_32.c | 33 ++-------------------
arch/sparc/mm/init_64.c | 27 ++----------------
arch/tile/include/asm/sections.h | 2 +-
arch/tile/kernel/setup.c | 20 ++++++-------
arch/tile/kernel/vmlinux.lds.S | 4 ++-
arch/tile/mm/init.c | 17 ++---------
arch/um/include/asm/common.lds.S | 1 -
arch/um/kernel/dyn.lds.S | 6 ++--
arch/um/kernel/mem.c | 4 +--
arch/um/kernel/uml.lds.S | 7 +++--
arch/unicore32/mm/init.c | 49 ++-----------------------------
arch/x86/kernel/cpu/amd.c | 2 +-
arch/x86/kernel/setup.c | 2 --
arch/x86/mm/init_32.c | 30 ++-----------------
arch/x86/mm/init_64.c | 20 +------------
arch/x86/mm/numa_32.c | 2 --
arch/xtensa/mm/init.c | 27 ++----------------
fs/fuse/inode.c | 2 +-
include/asm-generic/sections.h | 21 +++++++++++++-
include/linux/mm.h | 13 ++++++++-
kernel/power/snapshot.c | 4 +--
mm/memory.c | 2 --
mm/memory_hotplug.c | 4 ---
mm/nommu.c | 2 --
mm/page_alloc.c | 52 +++++++++++++++++++++++++++++++++
net/ipv4/inet_fragment.c | 2 +-
62 files changed, 256 insertions(+), 986 deletions(-)
--
1.7.9.5
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2013-03-24 7:27 UTC|newest]
Thread overview: 80+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-24 7:24 Jiang Liu [this message]
2013-03-24 7:24 ` [RFC PATCH v2, part4 01/39] vmlinux.lds: add comments for global variables and clean up useless declarations Jiang Liu
2013-03-24 9:47 ` Arnd Bergmann
2013-03-24 7:24 ` [RFC PATCH v2, part4 02/39] avr32: normalize global variables exported by vmlinux.lds Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 03/39] c6x: " Jiang Liu
2013-03-25 17:56 ` Mark Salter
2013-03-26 15:23 ` Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 04/39] h8300: " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 05/39] score: " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 06/39] tile: " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 07/39] UML: " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 08/39] mm: introduce helper function mem_init_print_info() to simplify mem_init() Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 09/39] mm/alpha: prepare for removing num_physpages and " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 09/39] mm: use totalram_pages instead of num_physpages at runtime Jiang Liu
2013-03-24 12:26 ` Sergei Shtylyov
2013-03-24 7:24 ` [RFC PATCH v2, part4 10/39] mm/alpha: prepare for removing num_physpages and simplify mem_init() Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 10/39] mm/ARM: " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 11/39] mm/ARM64: " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 11/39] mm/ARM: " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 12/39] mm/ARM64: " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 12/39] mm/AVR32: " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 13/39] " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 13/39] mm/blackfin: " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 14/39] " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 14/39] mm/c6x: " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 15/39] " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 15/39] mm/cris: " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 16/39] " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 16/39] mm/frv: " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 17/39] " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 17/39] mm/h8300: " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 18/39] " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 18/39] mm/hexagon: " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 19/39] " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 19/39] mm/IA64: " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 20/39] " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 20/39] mm/m32r: " Jiang Liu
2013-03-24 7:24 ` [RFC PATCH v2, part4 21/39] " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 21/39] mm/m68k: " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 22/39] " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 22/39] mm/microblaze: " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 23/39] " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 23/39] mm/MIPS: " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 24/39] " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 24/39] mm/mn10300: " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 25/39] " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 25/39] mm/openrisc: " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 26/39] " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 26/39] mm/PARISC: " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 27/39] " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 27/39] mm/ppc: " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 28/39] " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 28/39] mm/s390: " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 29/39] " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 29/39] mm/score: " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 30/39] " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 30/39] mm/SH: " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 31/39] " Jiang Liu
2013-03-24 12:06 ` Sergei Shtylyov
2013-03-24 12:11 ` Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 31/39] mm/SPARC: " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 32/39] " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 32/39] mm/tile: " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 33/39] " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 33/39] mm/um: " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 34/39] " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 34/39] mm/unicore32: " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 35/39] " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 35/39] mm/x86: " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 36/39] " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 36/39] mm/xtensa: " Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 37/39] mm: use totalram_pages instead of num_physpages at runtime Jiang Liu
2013-03-24 12:27 ` Sergei Shtylyov
2013-03-24 7:25 ` [RFC PATCH v2, part4 37/39] mm/xtensa: prepare for removing num_physpages and simplify mem_init() Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 38/39] mm/hotplug: prepare for removing num_physpages Jiang Liu
2013-03-24 7:25 ` [RFC PATCH v2, part4 39/39] mm: kill global variable num_physpages Jiang Liu
2013-03-24 8:11 ` [RFC PATCH v2, part4 00/39] Simplify mem_init() implementations and kill num_physpages James Bottomley
2013-03-25 16:19 ` Jiang Liu
2013-03-25 17:07 ` Vineet Gupta
2013-03-25 12:21 ` [RFC PATCH v2, part4 16/39] mm/frv: prepare for removing num_physpages and simplify mem_init() David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1364109934-7851-1-git-send-email-jiang.liu@huawei.com \
--to=liuj97@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=jiang.liu@huawei.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@suse.cz \
--cc=minchan@kernel.org \
--cc=rientjes@google.com \
--cc=wency@cn.fujitsu.com \
--cc=wujianguo@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).