WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: Some Problems about Xen Numa support !

To: 李亚琼 <liyaq04@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Re: Some Problems about Xen Numa support !
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Tue, 27 May 2008 08:36:31 +0100
Delivery-date: Tue, 27 May 2008 00:37:00 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20080527005253.7929613681C@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Aci6+hF+YhEq8yFNQuaQFELcgVMpswADw1KwASMEZJAADcxK3g==
Thread-topic: Some Problems about Xen Numa support!
User-agent: Microsoft-Entourage/11.4.0.080122
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:

HiAll
         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 <=