lkml.org 
[lkml]   [2008]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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




\
 
 \ /
  Last update: 2008-09-30 10:11    [W:0.066 / U:3.856 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site