Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 17990
b: refs/heads/master
c: 05b3cbd
h: refs/heads/master
v: v3
  • Loading branch information
Ravikiran Thirumalai authored and Linus Torvalds committed Jan 12, 2006
1 parent 766cd0e commit b8bbe08
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0b91317e338f42367de6d53f5e14f273aae7d034
refs/heads/master: 05b3cbd8bb98736387df8a2e1efe311b1fb4d2ad
2 changes: 2 additions & 0 deletions trunk/arch/x86_64/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,8 @@ void __init setup_arch(char **cmdline_p)
acpi_boot_init();
#endif

init_cpu_to_node();

#ifdef CONFIG_X86_LOCAL_APIC
/*
* get boot-time SMP configuration:
Expand Down
25 changes: 25 additions & 0 deletions trunk/arch/x86_64/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,31 @@ __init int numa_setup(char *opt)
return 1;
}

/*
* Setup early cpu_to_node.
*
* Populate cpu_to_node[] only if x86_cpu_to_apicid[],
* and apicid_to_node[] tables have valid entries for a CPU.
* This means we skip cpu_to_node[] initialisation for NUMA
* emulation and faking node case (when running a kernel compiled
* for NUMA on a non NUMA box), which is OK as cpu_to_node[]
* is already initialized in a round robin manner at numa_init_array,
* prior to this call, and this initialization is good enough
* for the fake NUMA cases.
*/
void __init init_cpu_to_node(void)
{
int i;
for (i = 0; i < NR_CPUS; i++) {
u8 apicid = x86_cpu_to_apicid[i];
if (apicid == BAD_APICID)
continue;
if (apicid_to_node[apicid] == NUMA_NO_NODE)
continue;
cpu_to_node[i] = apicid_to_node[apicid];
}
}

EXPORT_SYMBOL(cpu_to_node);
EXPORT_SYMBOL(node_to_cpumask);
EXPORT_SYMBOL(memnode_shift);
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/asm-x86_64/numa.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ extern int numa_off;
extern void numa_set_node(int cpu, int node);

extern unsigned char apicid_to_node[256];
#ifdef CONFIG_NUMA
extern void __init init_cpu_to_node(void);
#else
#define init_cpu_to_node() do {} while (0)
#endif

#define NUMA_NO_NODE 0xff

Expand Down

0 comments on commit b8bbe08

Please sign in to comment.