[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130111102924.GE7286@dhcp22.suse.cz>
Date: Fri, 11 Jan 2013 11:29:24 +0100
From: Michal Hocko <mhocko@...e.cz>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Wen Congyang <wency@...fujitsu.com>,
Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>,
Tang Chen <tangchen@...fujitsu.com>,
Wu Jianguo <wujianguo@...wei.com>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Jiang Liu <jiang.liu@...wei.com>,
Kamezawa Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Lai Jiangshan <laijs@...fujitsu.com>,
Ingo Molnar <mingo@...e.hu>,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>, linux-mm@...ck.org,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: mmots: memory-hotplug: implement
register_page_bootmem_info_section of sparse-vmemmap fix
On Fri 11-01-13 11:17:45, Michal Hocko wrote:
[...]
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index be2b90c..59eddff 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -128,6 +128,64 @@ void __ref put_page_bootmem(struct page *page)
>
> }
>
> +void register_page_bootmem_memmap(unsigned long section_nr,
> + struct page *start_page, unsigned long size)
> +{
> + unsigned long addr = (unsigned long)start_page;
> + unsigned long end = (unsigned long)(start_page + size);
> + unsigned long next;
> + pgd_t *pgd;
> + pud_t *pud;
> + pmd_t *pmd;
> + unsigned int nr_pages;
> + struct page *page;
> +
> + for (; addr < end; addr = next) {
> + pte_t *pte = NULL;
> +
> + pgd = pgd_offset_k(addr);
> + if (pgd_none(*pgd)) {
> + next = (addr + PAGE_SIZE) & PAGE_MASK;
> + continue;
> + }
> + get_page_bootmem(section_nr, pgd_page(*pgd), MIX_SECTION_INFO);
> +
> + pud = pud_offset(pgd, addr);
> + if (pud_none(*pud)) {
> + next = (addr + PAGE_SIZE) & PAGE_MASK;
> + continue;
> + }
> + get_page_bootmem(section_nr, pud_page(*pud), MIX_SECTION_INFO);
> +
> + if (!cpu_has_pse) {
Darn! And now that I am looking at the patch closer it is too x86
centric so this cannot be in the generic code. I will try to cook
something better. Sorry about the noise.
[...]
--
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists