|   | 
      | 
  
  
      | 
      | 
  
 
     | 
    | 
  
  
     | 
    | 
  
  
    |   | 
      | 
  
  
    | 
         
xen-devel
[Xen-devel] Re: Some Problems about Xen Numa support !
 
Probably Linux lets yuou specify NUMA topology on the command line, or something like that, and the loop you point out is inherited from that support. 
 
 -- Keir 
 
On 27/5/08 02:02, "李亚琼" <liyaq04@xxxxxxxxxx> wrote: 
 
Hi,All 
         I am reading the concerned source code of Numa support in Xen source tree. I have been puzzled with the initialization of Numa support. During the initialization, the function ‘acpi_scan_nodes’ is called to scan the information about numa system. It converts some temporary variables into final variables, such as nodes -> node_data。My puzzles locate in the last lines of this function: 
int __init acpi_scan_nodes(u64 start, u64 end) 
{ 
……… 
         /* Finally register nodes */ 
         for_each_node_mask(i, nodes_parsed) 
                  setup_node_bootmem(i, nodes[i].start, nodes[i].end); 
         for (i = 0; i < NR_CPUS; i++) {  
                  if (cpu_to_node[i] == NUMA_NO_NODE) 
                           continue; 
                  if (!node_isset(cpu_to_node[i], nodes_parsed)) 
                           numa_set_node(i, NUMA_NO_NODE); 
         } 
        numa_init_array(); 
        return 0; 
} 
According my study, the variable ‘cpu_to_node’ has a unified value—NUMA_NO_NODE before this codes being executed. So, the ‘for loop’ will have no effect. Is it correct? 
The following function ‘numa_init_array’ will be called. Its source code is here: 
void __init numa_init_array(void) 
{ 
         int rr, i; 
         /* There are unfortunately some poorly designed mainboards around 
           that only connect memory to a single CPU. This breaks the 1:1 cpu->node 
           mapping. To avoid this fill in the mapping for all possible 
           CPUs, as the number of CPUs is not known yet.  
           We round robin the existing nodes. */ 
         rr = first_node(node_online_map); 
         for (i = 0; i < NR_CPUS; i++) { 
                  if (cpu_to_node[i] != NUMA_NO_NODE) 
                           continue; 
                 numa_set_node(i, rr); 
                  rr = next_node(rr, node_online_map); 
                  if (rr == MAX_NUMNODES) 
                           rr = first_node(node_online_map); 
         } 
  
} 
I don’t understand why it is called here. I think it should be called after cpu_to_node being initialized with correct value. 
Thanks a lot! 
  
-Techie 
  
  
 
  
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
 
 |   
 
| <Prev in Thread] | 
Current Thread | 
[Next in Thread> |  
- [Xen-devel] Re: Some Problems about Xen Numa support !,
Keir Fraser <=
  
 |  
  
 | 
    | 
  
  
    |   | 
    |