[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080930163324.44A7.E1E9C6FF@jp.fujitsu.com>
Date: Tue, 30 Sep 2008 17:06:08 +0900
From: Yasunori Goto <y-goto@...fujitsu.com>
To: Gary Hade <garyhade@...ibm.com>
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
Badari Pulavarty <pbadari@...ibm.com>,
Mel Gorman <mel@....ul.ie>, Chris McDermott <lcm@...ibm.com>,
linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
Greg KH <greg@...ah.com>,
Dave Hansen <dave@...ux.vnet.ibm.com>,
Nish Aravamudan <nish.aravamudan@...il.com>
Subject: Re: [PATCH] mm: show node to memory section relationship with symlinks in sysfs
> +#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
> +int register_mem_sect_under_node(struct memory_block *mem_blk)
:
I think this patch is convenience even when memory hotplug is disabled.
CONFIG_SPARSEMEM seems better than CONFIG_MEMORY_HOTPLUG_SPARSE.
> +int register_mem_sect_under_node(struct memory_block *mem_blk)
> +{
> + unsigned int nid;
> +
> + if (!mem_blk)
> + return -EFAULT;
> + nid = section_nr_to_nid(mem_blk->phys_index);
(snip)
> +#define section_nr_to_nid(section_nr) pfn_to_nid(section_nr_to_pfn(section_nr))
> #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */
If the first page of the section is not valid, then this section_nr_to_nid()
doesn't return correct value.
I tested this patch. In my box, the start_pfn of node 1 is 1200400, but
section_nr_to_pfn(mem_blk->phys_index) returns 1200000. As a result,
the section is linked to node 0.
Bye.
--
Yasunori Goto
--
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