Release 4.14 arch/x86/mm/srat.c
// SPDX-License-Identifier: GPL-2.0
/*
* 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/init.h>
#include <linux/topology.h>
#include <linux/mm.h>
#include <asm/proto.h>
#include <asm/numa.h>
#include <asm/e820/api.h>
#include <asm/apic.h>
#include <asm/uv/uv.h>
/* 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 = acpi_map_pxm_to_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);
printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%04x -> Node %u\n",
pxm, apic_id, node);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Suresh B. Siddha | 104 | 62.28% | 1 | 11.11% |
Yinghai Lu | 46 | 27.54% | 3 | 33.33% |
Jack Steiner | 6 | 3.59% | 1 | 11.11% |
Tejun Heo | 5 | 2.99% | 2 | 22.22% |
Steffen Persvold | 5 | 2.99% | 1 | 11.11% |
Hanjun Guo | 1 | 0.60% | 1 | 11.11% |
Total | 167 | 100.00% | 9 | 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 = acpi_map_pxm_to_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);
printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%02x -> Node %u\n",
pxm, apic_id, node);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Andi Kleen | 94 | 50.00% | 3 | 20.00% |
Jack Steiner | 28 | 14.89% | 3 | 20.00% |
Yinghai Lu | 28 | 14.89% | 3 | 20.00% |
Kurt Garloff | 22 | 11.70% | 1 | 6.67% |
Alexey Y. Starikovskiy | 7 | 3.72% | 1 | 6.67% |
Tejun Heo | 5 | 2.66% | 2 | 13.33% |
Mike Travis | 3 | 1.60% | 1 | 6.67% |
Hanjun Guo | 1 | 0.53% | 1 | 6.67% |
Total | 188 | 100.00% | 15 | 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 | 34 | 100.00% | 1 | 100.00% |
Total | 34 | 100.00% | 1 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Andi Kleen | 124 | 28.90% | 5 | 19.23% |
Suresh B. Siddha | 105 | 24.48% | 1 | 3.85% |
Yinghai Lu | 74 | 17.25% | 4 | 15.38% |
Tejun Heo | 44 | 10.26% | 3 | 11.54% |
Jack Steiner | 36 | 8.39% | 3 | 11.54% |
Kurt Garloff | 22 | 5.13% | 1 | 3.85% |
Alexey Y. Starikovskiy | 7 | 1.63% | 1 | 3.85% |
Steffen Persvold | 5 | 1.17% | 1 | 3.85% |
Ingo Molnar | 5 | 1.17% | 3 | 11.54% |
Mike Travis | 3 | 0.70% | 1 | 3.85% |
Hanjun Guo | 2 | 0.47% | 1 | 3.85% |
Paul Gortmaker | 1 | 0.23% | 1 | 3.85% |
Greg Kroah-Hartman | 1 | 0.23% | 1 | 3.85% |
Total | 429 | 100.00% | 26 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.