From: Jonas Bonn <jonas@southpole.se>
To: Jiang Liu <liuj97@gmail.com>
Cc: linux-arch@vger.kernel.org,
James Bottomley <James.Bottomley@HansenPartnership.com>,
David Howells <dhowells@redhat.com>,
Jiang Liu <jiang.liu@huawei.com>,
Wen Congyang <wency@cn.fujitsu.com>,
linux-mm@kvack.org, linux@lists.openrisc.net,
Mark Salter <msalter@redhat.com>,
linux-kernel@vger.kernel.org, Michal Hocko <mhocko@suse.cz>,
Minchan Kim <minchan@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
Mel Gorman <mgorman@suse.de>,
David Rientjes <rientjes@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Jianguo Wu <wujianguo@huawei.com>
Subject: Re: [PATCH v3, part4 26/39] mm/openrisc: prepare for removing num_physpages and simplify mem_init()
Date: Tue, 02 Apr 2013 07:31:44 +0200 [thread overview]
Message-ID: <515A6D40.90702@southpole.se> (raw)
In-Reply-To: <1364313298-17336-27-git-send-email-jiang.liu@huawei.com>
On 03/26/2013 04:54 PM, Jiang Liu wrote:
> Prepare for removing num_physpages and simplify mem_init().
>
> Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
> Cc: Jonas Bonn <jonas@southpole.se>
> Cc: David Howells <dhowells@redhat.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: linux@lists.openrisc.net
> Cc: linux-kernel@vger.kernel.org
Tested and works fine on OpenRISC.
Acked-by: Jonas Bonn <jonas@southpole.se>
/Jonas
> ---
> Hi all,
> Sorry for my mistake that my previous patch series has been screwed up.
> So I regenerate a third version and also set up a git tree at:
> git://github.com/jiangliu/linux.git mem_init
> Any help to review and test are welcomed!
>
> Regards!
> Gerry
> ---
> arch/openrisc/mm/init.c | 44 ++++----------------------------------------
> 1 file changed, 4 insertions(+), 40 deletions(-)
>
> diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c
> index 71d6b40..f3c8f47 100644
> --- a/arch/openrisc/mm/init.c
> +++ b/arch/openrisc/mm/init.c
> @@ -191,56 +191,20 @@ void __init paging_init(void)
>
> /* References to section boundaries */
>
> -static int __init free_pages_init(void)
> -{
> - int reservedpages, pfn;
> -
> - /* this will put all low memory onto the freelists */
> - free_all_bootmem();
> -
> - reservedpages = 0;
> - for (pfn = 0; pfn < max_low_pfn; pfn++) {
> - /*
> - * Only count reserved RAM pages
> - */
> - if (PageReserved(mem_map + pfn))
> - reservedpages++;
> - }
> -
> - return reservedpages;
> -}
> -
> -static void __init set_max_mapnr_init(void)
> -{
> - max_mapnr = num_physpages = max_low_pfn;
> -}
> -
> void __init mem_init(void)
> {
> - int codesize, reservedpages, datasize, initsize;
> -
> BUG_ON(!mem_map);
>
> - set_max_mapnr_init();
> -
> + max_mapnr = max_low_pfn;
> high_memory = (void *)__va(max_low_pfn * PAGE_SIZE);
>
> /* clear the zero-page */
> memset((void *)empty_zero_page, 0, PAGE_SIZE);
>
> - reservedpages = free_pages_init();
> -
> - codesize = (unsigned long)&_etext - (unsigned long)&_stext;
> - datasize = (unsigned long)&_edata - (unsigned long)&_etext;
> - initsize = (unsigned long)&__init_end - (unsigned long)&__init_begin;
> + /* this will put all low memory onto the freelists */
> + free_all_bootmem();
>
> - printk(KERN_INFO
> - "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init, %ldk highmem)\n",
> - (unsigned long)nr_free_pages() << (PAGE_SHIFT - 10),
> - max_mapnr << (PAGE_SHIFT - 10), codesize >> 10,
> - reservedpages << (PAGE_SHIFT - 10), datasize >> 10,
> - initsize >> 10, (unsigned long)(0 << (PAGE_SHIFT - 10))
> - );
> + mem_init_print_info(NULL);
>
> printk("mem_init_done ...........................................\n");
> mem_init_done = 1;
WARNING: multiple messages have this Message-ID (diff)
From: Jonas Bonn <jonas@southpole.se>
To: Jiang Liu <liuj97@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
David Rientjes <rientjes@google.com>,
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>,
James Bottomley <James.Bottomley@HansenPartnership.com>,
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
David Howells <dhowells@redhat.com>,
Mark Salter <msalter@redhat.com>,
Jianguo Wu <wujianguo@huawei.com>,
linux-mm@kvack.org, linux-arch@vger.kernel.org,
linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
linux@lists.openrisc.net
Subject: Re: [PATCH v3, part4 26/39] mm/openrisc: prepare for removing num_physpages and simplify mem_init()
Date: Tue, 02 Apr 2013 07:31:44 +0200 [thread overview]
Message-ID: <515A6D40.90702@southpole.se> (raw)
Message-ID: <20130402053144.AMQN4ZnkcLPm1EImB4OVVyVJe3Jf3uYGS0iJRscwUzM@z> (raw)
In-Reply-To: <1364313298-17336-27-git-send-email-jiang.liu@huawei.com>
On 03/26/2013 04:54 PM, Jiang Liu wrote:
> Prepare for removing num_physpages and simplify mem_init().
>
> Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
> Cc: Jonas Bonn <jonas@southpole.se>
> Cc: David Howells <dhowells@redhat.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: linux@lists.openrisc.net
> Cc: linux-kernel@vger.kernel.org
Tested and works fine on OpenRISC.
Acked-by: Jonas Bonn <jonas@southpole.se>
/Jonas
> ---
> Hi all,
> Sorry for my mistake that my previous patch series has been screwed up.
> So I regenerate a third version and also set up a git tree at:
> git://github.com/jiangliu/linux.git mem_init
> Any help to review and test are welcomed!
>
> Regards!
> Gerry
> ---
> arch/openrisc/mm/init.c | 44 ++++----------------------------------------
> 1 file changed, 4 insertions(+), 40 deletions(-)
>
> diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c
> index 71d6b40..f3c8f47 100644
> --- a/arch/openrisc/mm/init.c
> +++ b/arch/openrisc/mm/init.c
> @@ -191,56 +191,20 @@ void __init paging_init(void)
>
> /* References to section boundaries */
>
> -static int __init free_pages_init(void)
> -{
> - int reservedpages, pfn;
> -
> - /* this will put all low memory onto the freelists */
> - free_all_bootmem();
> -
> - reservedpages = 0;
> - for (pfn = 0; pfn < max_low_pfn; pfn++) {
> - /*
> - * Only count reserved RAM pages
> - */
> - if (PageReserved(mem_map + pfn))
> - reservedpages++;
> - }
> -
> - return reservedpages;
> -}
> -
> -static void __init set_max_mapnr_init(void)
> -{
> - max_mapnr = num_physpages = max_low_pfn;
> -}
> -
> void __init mem_init(void)
> {
> - int codesize, reservedpages, datasize, initsize;
> -
> BUG_ON(!mem_map);
>
> - set_max_mapnr_init();
> -
> + max_mapnr = max_low_pfn;
> high_memory = (void *)__va(max_low_pfn * PAGE_SIZE);
>
> /* clear the zero-page */
> memset((void *)empty_zero_page, 0, PAGE_SIZE);
>
> - reservedpages = free_pages_init();
> -
> - codesize = (unsigned long)&_etext - (unsigned long)&_stext;
> - datasize = (unsigned long)&_edata - (unsigned long)&_etext;
> - initsize = (unsigned long)&__init_end - (unsigned long)&__init_begin;
> + /* this will put all low memory onto the freelists */
> + free_all_bootmem();
>
> - printk(KERN_INFO
> - "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init, %ldk highmem)\n",
> - (unsigned long)nr_free_pages() << (PAGE_SHIFT - 10),
> - max_mapnr << (PAGE_SHIFT - 10), codesize >> 10,
> - reservedpages << (PAGE_SHIFT - 10), datasize >> 10,
> - initsize >> 10, (unsigned long)(0 << (PAGE_SHIFT - 10))
> - );
> + mem_init_print_info(NULL);
>
> printk("mem_init_done ...........................................\n");
> mem_init_done = 1;
next prev parent reply other threads:[~2013-04-02 5:31 UTC|newest]
Thread overview: 92+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-26 15:54 [PATCH v3, part4 00/39] Simplify mem_init() implementations and kill num_physpages Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 01/39] vmlinux.lds: add comments for global variables and clean up useless declarations Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 02/39] avr32: normalize global variables exported by vmlinux.lds Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 03/39] c6x: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 04/39] h8300: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 05/39] score: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 06/39] tile: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 07/39] UML: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 08/39] mm: introduce helper function mem_init_print_info() to simplify mem_init() Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 09/39] mm: use totalram_pages instead of num_physpages at runtime Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 10/39] mm/alpha: prepare for removing num_physpages and simplify mem_init() Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 11/39] mm/ARM: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 12/39] mm/ARM64: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 13/39] mm/AVR32: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 14/39] mm/blackfin: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 15/39] mm/c6x: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 16/39] mm/cris: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 17/39] mm/frv: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 18/39] mm/h8300: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 19/39] mm/hexagon: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 20/39] mm/IA64: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 21/39] mm/m32r: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 22/39] mm/m68k: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 23/39] mm/microblaze: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 24/39] mm/MIPS: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 25/39] mm/mn10300: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 26/39] mm/openrisc: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-04-02 5:31 ` Jonas Bonn [this message]
2013-04-02 5:31 ` Jonas Bonn
2013-04-02 14:38 ` Jiang Liu
2013-04-02 14:38 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 27/39] mm/PARISC: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 28/39] mm/ppc: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 29/39] mm/s390: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 30/39] mm/score: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 31/39] mm/SH: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 32/39] mm/SPARC: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-29 16:17 ` Sam Ravnborg
2013-03-26 15:54 ` [PATCH v3, part4 33/39] mm/tile: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 34/39] mm/um: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 35/39] mm/unicore32: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 36/39] mm/x86: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 37/39] mm/xtensa: " Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 38/39] mm/hotplug: prepare for removing num_physpages Jiang Liu
2013-03-26 15:54 ` Jiang Liu
2013-03-29 11:18 ` Sam Ravnborg
2013-03-29 15:36 ` Jiang Liu
2013-03-29 16:17 ` Sam Ravnborg
2013-03-29 16:17 ` Sam Ravnborg
2013-03-29 16:30 ` Jiang Liu
2013-03-29 16:40 ` Sam Ravnborg
2013-03-29 16:42 ` Jiang Liu
2013-03-26 15:54 ` [PATCH v3, part4 39/39] mm: kill global variable num_physpages Jiang Liu
2013-03-26 15:54 ` Jiang Liu
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=515A6D40.90702@southpole.se \
--to=jonas@southpole.se \
--cc=James.Bottomley@HansenPartnership.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=dhowells@redhat.com \
--cc=jiang.liu@huawei.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@lists.openrisc.net \
--cc=liuj97@gmail.com \
--cc=mgorman@suse.de \
--cc=mhocko@suse.cz \
--cc=minchan@kernel.org \
--cc=msalter@redhat.com \
--cc=rientjes@google.com \
--cc=sergei.shtylyov@cogentembedded.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).