cregit-Linux how code gets into the kernel

Release 4.14 arch/x86/mm/srat.c

Directory: arch/x86/mm
// 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

PersonTokensPropCommitsCommitProp
Suresh B. Siddha10462.28%111.11%
Yinghai Lu4627.54%333.33%
Jack Steiner63.59%111.11%
Tejun Heo52.99%222.22%
Steffen Persvold52.99%111.11%
Hanjun Guo10.60%111.11%
Total167100.00%9100.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

PersonTokensPropCommitsCommitProp
Andi Kleen9450.00%320.00%
Jack Steiner2814.89%320.00%
Yinghai Lu2814.89%320.00%
Kurt Garloff2211.70%16.67%
Alexey Y. Starikovskiy73.72%16.67%
Tejun Heo52.66%213.33%
Mike Travis31.60%16.67%
Hanjun Guo10.53%16.67%
Total188100.00%15100.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

PersonTokensPropCommitsCommitProp
Tejun Heo34100.00%1100.00%
Total34100.00%1100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Andi Kleen12428.90%519.23%
Suresh B. Siddha10524.48%13.85%
Yinghai Lu7417.25%415.38%
Tejun Heo4410.26%311.54%
Jack Steiner368.39%311.54%
Kurt Garloff225.13%13.85%
Alexey Y. Starikovskiy71.63%13.85%
Steffen Persvold51.17%13.85%
Ingo Molnar51.17%311.54%
Mike Travis30.70%13.85%
Hanjun Guo20.47%13.85%
Paul Gortmaker10.23%13.85%
Greg Kroah-Hartman10.23%13.85%
Total429100.00%26100.00%
Directory: arch/x86/mm
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.