Release 4.7 arch/x86/mm/srat.c
/*
* ACPI 3.0 based NUMA setup
* Copyright 2004 Andi Kleen, SuSE Labs.
*
* Reads the ACPI SRAT table to figure out what memory belongs to which CPUs.
*
* Called from acpi_numa_init while reading the SRAT and SLIT tables.
* Assumes all memory regions belonging to a single proximity domain
* are in one chunk. Holes between them will be included in the node.
*/
#include <linux/kernel.h>
#include <linux/acpi.h>
#include <linux/mmzone.h>
#include <linux/bitmap.h>
#include <linux/module.h>
#include <linux/topology.h>
#include <linux/bootmem.h>
#include <linux/memblock.h>
#include <linux/mm.h>
#include <asm/proto.h>
#include <asm/numa.h>
#include <asm/e820.h>
#include <asm/apic.h>
#include <asm/uv/uv.h>
int acpi_numa __initdata;
static __init int setup_node(int pxm)
{
return acpi_map_pxm_to_node(pxm);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| andi kleen | andi kleen | 14 | 87.50% | 2 | 66.67% |
| yasunori goto | yasunori goto | 2 | 12.50% | 1 | 33.33% |
| Total | 16 | 100.00% | 3 | 100.00% |
static __init void bad_srat(void)
{
printk(KERN_ERR "SRAT: SRAT not used.\n");
acpi_numa = -1;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| andi kleen | andi kleen | 20 | 100.00% | 2 | 100.00% |
| Total | 20 | 100.00% | 2 | 100.00% |
static __init inline int srat_disabled(void)
{
return acpi_numa < 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| andi kleen | andi kleen | 15 | 100.00% | 1 | 100.00% |
| Total | 15 | 100.00% | 1 | 100.00% |
/*
* Callback for SLIT parsing. pxm_to_node() returns NUMA_NO_NODE for
* I/O localities since SRAT does not list them. I/O localities are
* not supported at this point.
*/
void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
{
int i, j;
for (i = 0; i < slit->locality_count; i++) {
const int from_node = pxm_to_node(i);
if (from_node == NUMA_NO_NODE)
continue;
for (j = 0; j < slit->locality_count; j++) {
const int to_node = pxm_to_node(j);
if (to_node == NUMA_NO_NODE)
continue;
numa_set_distance(from_node, to_node,
slit->entry[slit->locality_count * i + j]);
}
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| tejun heo | tejun heo | 53 | 51.96% | 1 | 25.00% |
| toshi kani | toshi kani | 20 | 19.61% | 1 | 25.00% |
| yinghai lu | yinghai lu | 18 | 17.65% | 1 | 25.00% |
| andi kleen | andi kleen | 11 | 10.78% | 1 | 25.00% |
| Total | 102 | 100.00% | 4 | 100.00% |
/* Callback for Proximity Domain -> x2APIC mapping */
void __init
acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
{
int pxm, node;
int apic_id;
if (srat_disabled())
return;
if (pa->header.length < sizeof(struct acpi_srat_x2apic_cpu_affinity)) {
bad_srat();
return;
}
if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0)
return;
pxm = pa->proximity_domain;
apic_id = pa->apic_id;
if (!apic->apic_id_valid(apic_id)) {
printk(KERN_INFO "SRAT: PXM %u -> X2APIC 0x%04x ignored\n",
pxm, apic_id);
return;
}
node = setup_node(pxm);
if (node < 0) {
printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm);
bad_srat();
return;
}
if (apic_id >= MAX_LOCAL_APIC) {
printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%04x -> Node %u skipped apicid that is too big\n", pxm, apic_id, node);
return;
}
set_apicid_to_node(apic_id, node);
node_set(node, numa_nodes_parsed);
acpi_numa = 1;
printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%04x -> Node %u\n",
pxm, apic_id, node);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| suresh siddha | suresh siddha | 109 | 63.74% | 1 | 12.50% |
| yinghai lu | yinghai lu | 46 | 26.90% | 3 | 37.50% |
| jack steiner | jack steiner | 6 | 3.51% | 1 | 12.50% |
| tejun heo | tejun heo | 5 | 2.92% | 2 | 25.00% |
| steffen persvold | steffen persvold | 5 | 2.92% | 1 | 12.50% |
| Total | 171 | 100.00% | 8 | 100.00% |
/* Callback for Proximity Domain -> LAPIC mapping */
void __init
acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
{
int pxm, node;
int apic_id;
if (srat_disabled())
return;
if (pa->header.length != sizeof(struct acpi_srat_cpu_affinity)) {
bad_srat();
return;
}
if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0)
return;
pxm = pa->proximity_domain_lo;
if (acpi_srat_revision >= 2)
pxm |= *((unsigned int*)pa->proximity_domain_hi) << 8;
node = setup_node(pxm);
if (node < 0) {
printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm);
bad_srat();
return;
}
if (get_uv_system_type() >= UV_X2APIC)
apic_id = (pa->apic_id << 8) | pa->local_sapic_eid;
else
apic_id = pa->apic_id;
if (apic_id >= MAX_LOCAL_APIC) {
printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%02x -> Node %u skipped apicid that is too big\n", pxm, apic_id, node);
return;
}
set_apicid_to_node(apic_id, node);
node_set(node, numa_nodes_parsed);
acpi_numa = 1;
printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%02x -> Node %u\n",
pxm, apic_id, node);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| andi kleen | andi kleen | 99 | 51.56% | 3 | 21.43% |
| jack steiner | jack steiner | 28 | 14.58% | 3 | 21.43% |
| yinghai lu | yinghai lu | 28 | 14.58% | 3 | 21.43% |
| kurt garloff | kurt garloff | 22 | 11.46% | 1 | 7.14% |
| alexey starikovskiy | alexey starikovskiy | 7 | 3.65% | 1 | 7.14% |
| tejun heo | tejun heo | 5 | 2.60% | 2 | 14.29% |
| mike travis | mike travis | 3 | 1.56% | 1 | 7.14% |
| Total | 192 | 100.00% | 14 | 100.00% |
#ifdef CONFIG_MEMORY_HOTPLUG
static inline int save_add_info(void) {return 1;}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| keith mannthey | keith mannthey | 12 | 100.00% | 1 | 100.00% |
| Total | 12 | 100.00% | 1 | 100.00% |
#else
static inline int save_add_info(void) {return 0;}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| keith mannthey | keith mannthey | 12 | 100.00% | 1 | 100.00% |
| Total | 12 | 100.00% | 1 | 100.00% |
#endif
/* Callback for parsing of the Proximity Domain <-> Memory Area mappings */
int __init
acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
{
u64 start, end;
u32 hotpluggable;
int node, pxm;
if (srat_disabled())
goto out_err;
if (ma->header.length != sizeof(struct acpi_srat_mem_affinity))
goto out_err_bad_srat;
if ((ma->flags & ACPI_SRAT_MEM_ENABLED) == 0)
goto out_err;
hotpluggable = ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE;
if (hotpluggable && !save_add_info())
goto out_err;
start = ma->base_address;
end = start + ma->length;
pxm = ma->proximity_domain;
if (acpi_srat_revision <= 1)
pxm &= 0xff;
node = setup_node(pxm);
if (node < 0) {
printk(KERN_ERR "SRAT: Too many proximity domains.\n");
goto out_err_bad_srat;
}
if (numa_add_memblk(node, start, end) < 0)
goto out_err_bad_srat;
node_set(node, numa_nodes_parsed);
pr_info("SRAT: Node %u PXM %u [mem %#010Lx-%#010Lx]%s%s\n",
node, pxm,
(unsigned long long) start, (unsigned long long) end - 1,
hotpluggable ? " hotplug" : "",
ma->flags & ACPI_SRAT_MEM_NON_VOLATILE ? " non-volatile" : "");
/* Mark hotplug range in memblock. */
if (hotpluggable && memblock_mark_hotplug(start, ma->length))
pr_warn("SRAT: Failed to mark hotplug range [mem %#010Lx-%#010Lx] in memblock\n",
(unsigned long long)start, (unsigned long long)end - 1);
max_possible_pfn = max(max_possible_pfn, PFN_UP(end - 1));
return 0;
out_err_bad_srat:
bad_srat();
out_err:
return -1;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| andi kleen | andi kleen | 98 | 37.12% | 4 | 22.22% |
| tang chen | tang chen | 51 | 19.32% | 2 | 11.11% |
| davidlohr bueso | davidlohr bueso | 29 | 10.98% | 1 | 5.56% |
| tejun heo | tejun heo | 15 | 5.68% | 3 | 16.67% |
| igor mammedov | igor mammedov | 14 | 5.30% | 1 | 5.56% |
| bjorn helgaas | bjorn helgaas | 12 | 4.55% | 1 | 5.56% |
| linda knippers | linda knippers | 11 | 4.17% | 1 | 5.56% |
| kurt garloff | kurt garloff | 10 | 3.79% | 1 | 5.56% |
| alexey starikovskiy | alexey starikovskiy | 10 | 3.79% | 1 | 5.56% |
| yasuaki ishimatsu | yasuaki ishimatsu | 7 | 2.65% | 1 | 5.56% |
| thomas renninger | thomas renninger | 4 | 1.52% | 1 | 5.56% |
| keith mannthey | keith mannthey | 3 | 1.14% | 1 | 5.56% |
| Total | 264 | 100.00% | 18 | 100.00% |
void __init acpi_numa_arch_fixup(void) {}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| andi kleen | andi kleen | 6 | 85.71% | 1 | 50.00% |
| matthew dobson | matthew dobson | 1 | 14.29% | 1 | 50.00% |
| Total | 7 | 100.00% | 2 | 100.00% |
int __init x86_acpi_numa_init(void)
{
int ret;
ret = acpi_numa_init();
if (ret < 0)
return ret;
return srat_disabled() ? -EINVAL : 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| tejun heo | tejun heo | 34 | 100.00% | 1 | 100.00% |
| Total | 34 | 100.00% | 1 | 100.00% |
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| andi kleen | andi kleen | 303 | 33.55% | 9 | 20.00% |
| tejun heo | tejun heo | 113 | 12.51% | 8 | 17.78% |
| suresh siddha | suresh siddha | 110 | 12.18% | 1 | 2.22% |
| yinghai lu | yinghai lu | 95 | 10.52% | 6 | 13.33% |
| tang chen | tang chen | 51 | 5.65% | 2 | 4.44% |
| jack steiner | jack steiner | 36 | 3.99% | 3 | 6.67% |
| keith mannthey | keith mannthey | 33 | 3.65% | 1 | 2.22% |
| kurt garloff | kurt garloff | 32 | 3.54% | 1 | 2.22% |
| davidlohr bueso | davidlohr bueso | 29 | 3.21% | 1 | 2.22% |
| toshi kani | toshi kani | 21 | 2.33% | 1 | 2.22% |
| alexey starikovskiy | alexey starikovskiy | 17 | 1.88% | 1 | 2.22% |
| igor mammedov | igor mammedov | 14 | 1.55% | 1 | 2.22% |
| bjorn helgaas | bjorn helgaas | 12 | 1.33% | 1 | 2.22% |
| linda knippers | linda knippers | 11 | 1.22% | 1 | 2.22% |
| yasuaki ishimatsu | yasuaki ishimatsu | 7 | 0.78% | 1 | 2.22% |
| steffen persvold | steffen persvold | 5 | 0.55% | 1 | 2.22% |
| thomas renninger | thomas renninger | 4 | 0.44% | 1 | 2.22% |
| ingo molnar | ingo molnar | 4 | 0.44% | 2 | 4.44% |
| mike travis | mike travis | 3 | 0.33% | 1 | 2.22% |
| yasunori goto | yasunori goto | 2 | 0.22% | 1 | 2.22% |
| matthew dobson | matthew dobson | 1 | 0.11% | 1 | 2.22% |
| Total | 903 | 100.00% | 45 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.