linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
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>,
	Maciej Rutecki <maciej.rutecki@gmail.com>,
	Chris Clayton <chris2553@googlemail.com>,
	"Rafael J . Wysocki" <rjw@sisk.pl>, 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>,
	Anatolij Gustschin <agust@denx.de>,
	Aurelien Jacquiot <a-jacquiot@ti.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Chen Liqin <liqin.chen@sunplusct.com>,
	Chris Metcalf <cmetcalf@tilera.com>,
	Chris Zankel <chris@zankel.net>,
	David Howells <dhowells@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Biederman <ebiederm@xmission.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Guan Xuetao <gxt@mprc.pku.edu.cn>,
	Haavard Skinnemoen <hskinnemoen@gmail.com>,
	Hans-Christian Egtvedt <egtvedt@samfundet.no>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Helge Deller <deller@gmx.de>,
	James Hogan <james.hogan@imgtec.com>,
	Hirokazu Takata <takata@linux-m32r.org>,
	"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@redhat.com>,
	Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
	"James E.J. Bottomley" <jejb@parisc-linux.org>,
	Jeff Dike <jdike@addtoit.com>,
	Jeremy Fitzhardinge <jeremy@goop.org>,
	Jonas Bonn <jonas@southpole.se>,
	Koichi Yasutake <yasutake.koichi@jp.panasonic.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Lennox Wu <lennox.wu@gmail.com>, Mark Salter <msalter@redhat.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Matt Turner <mattst88@gmail.com>,
	Max Filippov <jcmvbkbc@gmail.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Michal Simek <monstr@monstr.eu>,
	Michel Lespinasse <walken@google.com>,
	Mikael Starvik <starvik@axis.com>,
	Mike Frysinger <vapier@gentoo.org>,
	Paul Mackerras <paulus@samba.org>,
	Paul Mundt <lethal@linux-sh.org>,
	Ralf Baechle <ralf@linux-mips.org>,
	Richard Henderson <rth@twiddle.net>,
	Rik van Riel <riel@redhat.com>,
	Russell King <linux@arm.linux.org.uk>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Sam Ravnborg <sam@ravnborg.org>,
	Tang Chen <tangchen@cn.fujitsu.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Tony Luck <tony.luck@intel.com>,
	Will Deacon <will.deacon@arm.com>,
	Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>,
	Yinghai Lu <yinghai@kernel.org>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	x86@kernel.org, xen-devel@lists.xensource.com,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	linux-arm-kernel@lists.infradead.org,
	Vineet Gupta <vgupta@synopsys.com>,
	linux-snps-arc@vger.kernel.org,
	virtualization@lists.linux-foundation.org
Subject: [PATCH v2, part1 00/29] Use helper functions to simplify memory intialization code
Date: Sun, 10 Mar 2013 14:26:43 +0800	[thread overview]
Message-ID: <1362896833-21104-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 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(-)

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

             reply	other threads:[~2013-03-10  6:29 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-10  6:26 Jiang Liu [this message]
2013-03-10  6:26 ` [PATCH v2, part1 01/29] mm: introduce common help functions to deal with reserved/managed pages Jiang Liu
2013-03-10  9:20   ` Geert Uytterhoeven
2013-03-11 22:17     ` Jiang Liu
2013-03-10  6:26 ` [PATCH v2, part1 02/29] mm/alpha: use common help functions to free reserved pages Jiang Liu
2013-03-10  6:26 ` [PATCH v2, part1 03/29] mm/ARM: " Jiang Liu
2013-04-04 15:47   ` Arnd Bergmann
2013-04-06 14:07     ` Jiang Liu
2013-03-10  6:26 ` [PATCH v2, part1 04/29] mm/avr32: " Jiang Liu
2013-03-10  6:26 ` [PATCH v2, part1 05/29] mm/blackfin: " Jiang Liu
2013-03-10  6:26 ` [PATCH v2, part1 06/29] mm/c6x: " Jiang Liu
2013-03-10  6:26 ` [PATCH v2, part1 07/29] mm/cris: " Jiang Liu
2013-03-10  6:26 ` [PATCH v2, part1 08/29] mm/FRV: " Jiang Liu
2013-03-10  6:26 ` [PATCH v2, part1 09/29] mm/h8300: " Jiang Liu
2013-03-10  6:26 ` [PATCH v2, part1 10/29] mm/IA64: " Jiang Liu
2013-03-10  6:26 ` [PATCH v2, part1 11/29] mm/m32r: " Jiang Liu
2013-03-10  6:26 ` [PATCH v2, part1 12/29] mm/m68k: " Jiang Liu
2013-03-10  9:21   ` Geert Uytterhoeven
2013-03-10  6:26 ` [PATCH v2, part1 13/29] mm/microblaze: " Jiang Liu
2013-03-10  6:26 ` [PATCH v2, part1 14/29] mm/MIPS: " Jiang Liu
2013-03-10  6:26 ` [PATCH v2, part1 15/29] mm/mn10300: " Jiang Liu
2013-03-10  6:26 ` [PATCH v2, part1 16/29] mm/openrisc: " Jiang Liu
2013-04-02  5:31   ` Jonas Bonn
2013-03-10  6:27 ` [PATCH v2, part1 17/29] mm/parisc: " Jiang Liu
2013-03-10  6:27 ` [PATCH v2, part1 18/29] mm/ppc: " Jiang Liu
2013-03-10  6:27 ` [PATCH v2, part1 19/29] mm/s390: " Jiang Liu
2013-03-10  6:27 ` [PATCH v2, part1 20/29] mm/score: " Jiang Liu
2013-03-10  6:27 ` [PATCH v2, part1 21/29] mm/SH: " Jiang Liu
2013-03-10  6:27 ` [PATCH v2, part1 22/29] mm/SPARC: " Jiang Liu
2013-03-10  7:28   ` Sam Ravnborg
2013-03-10  6:27 ` [PATCH v2, part1 23/29] mm/um: " Jiang Liu
2013-03-10  6:27 ` [PATCH v2, part1 24/29] mm/unicore32: " Jiang Liu
2013-03-10  6:27 ` [PATCH v2, part1 25/29] mm/x86: " Jiang Liu
2013-03-13  5:38   ` Yasuaki Ishimatsu
2013-03-13 16:45     ` Jiang Liu
2013-03-10  6:27 ` [PATCH v2, part1 26/29] mm/xtensa: " Jiang Liu
2013-03-10  6:27 ` [PATCH v2, part1 27/29] mm/arc: " Jiang Liu
2013-03-10  6:27 ` [PATCH v2, part1 28/29] mm/metag: " Jiang Liu
2013-03-10  6:27 ` [PATCH v2, part1 29/29] mm,kexec: " Jiang Liu
2013-03-11  5:16   ` Zhang Yanfei

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=1362896833-21104-1-git-send-email-jiang.liu@huawei.com \
    --to=liuj97@gmail.com \
    --cc=a-jacquiot@ti.com \
    --cc=agust@denx.de \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=catalin.marinas@arm.com \
    --cc=chris2553@googlemail.com \
    --cc=chris@zankel.net \
    --cc=cmetcalf@tilera.com \
    --cc=davem@davemloft.net \
    --cc=deller@gmx.de \
    --cc=dhowells@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=egtvedt@samfundet.no \
    --cc=fenghua.yu@intel.com \
    --cc=geert@linux-m68k.org \
    --cc=gxt@mprc.pku.edu.cn \
    --cc=heiko.carstens@de.ibm.com \
    --cc=hpa@zytor.com \
    --cc=hskinnemoen@gmail.com \
    --cc=ink@jurassic.park.msu.ru \
    --cc=isimatu.yasuaki@jp.fujitsu.com \
    --cc=james.hogan@imgtec.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=jdike@addtoit.com \
    --cc=jejb@parisc-linux.org \
    --cc=jeremy@goop.org \
    --cc=jiang.liu@huawei.com \
    --cc=jonas@southpole.se \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=konrad.wilk@oracle.com \
    --cc=lennox.wu@gmail.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-snps-arc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=liqin.chen@sunplusct.com \
    --cc=maciej.rutecki@gmail.com \
    --cc=mattst88@gmail.com \
    --cc=mgorman@suse.de \
    --cc=mhocko@suse.cz \
    --cc=minchan@kernel.org \
    --cc=mingo@redhat.com \
    --cc=monstr@monstr.eu \
    --cc=msalter@redhat.com \
    --cc=mst@redhat.com \
    --cc=paulus@samba.org \
    --cc=ralf@linux-mips.org \
    --cc=riel@redhat.com \
    --cc=rientjes@google.com \
    --cc=rjw@sisk.pl \
    --cc=rth@twiddle.net \
    --cc=rusty@rustcorp.com.au \
    --cc=sam@ravnborg.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=starvik@axis.com \
    --cc=takata@linux-m32r.org \
    --cc=tangchen@cn.fujitsu.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=vapier@gentoo.org \
    --cc=vgupta@synopsys.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=walken@google.com \
    --cc=wency@cn.fujitsu.com \
    --cc=will.deacon@arm.com \
    --cc=wujianguo@huawei.com \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xensource.com \
    --cc=yasutake.koichi@jp.panasonic.com \
    --cc=yinghai@kernel.org \
    --cc=ysato@users.sourceforge.jp \
    /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).