Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions | Variables
numa.c File Reference
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/init.h>
#include <linux/bootmem.h>
#include <linux/memblock.h>
#include <linux/mmzone.h>
#include <linux/ctype.h>
#include <linux/module.h>
#include <linux/nodemask.h>
#include <linux/sched.h>
#include <linux/topology.h>
#include <asm/e820.h>
#include <asm/proto.h>
#include <asm/dma.h>
#include <asm/acpi.h>
#include <asm/amd_nb.h>
#include "numa_internal.h"

Go to the source code of this file.

Functions

 EXPORT_SYMBOL (node_data)
 
 early_param ("numa", numa_setup)
 
int __cpuinit numa_cpu_node (int cpu)
 
 EXPORT_SYMBOL (node_to_cpumask_map)
 
 DEFINE_EARLY_PER_CPU (int, x86_cpu_to_node_map, NUMA_NO_NODE)
 
 EXPORT_EARLY_PER_CPU_SYMBOL (x86_cpu_to_node_map)
 
void __cpuinit numa_set_node (int cpu, int node)
 
void __cpuinit numa_clear_node (int cpu)
 
void __init setup_node_to_cpumask_map (void)
 
void __init numa_remove_memblk_from (int idx, struct numa_meminfo *mi)
 
int __init numa_add_memblk (int nid, u64 start, u64 end)
 
int __init numa_cleanup_meminfo (struct numa_meminfo *mi)
 
void __init numa_reset_distance (void)
 
void __init numa_set_distance (int from, int to, int distance)
 
int __node_distance (int from, int to)
 
 EXPORT_SYMBOL (__node_distance)
 
void __init x86_numa_init (void)
 
void __init init_cpu_to_node (void)
 
void __cpuinit numa_add_cpu (int cpu)
 
void __cpuinit numa_remove_cpu (int cpu)
 

Variables

int __initdata numa_off
 
nodemask_t numa_nodes_parsed __initdata
 
struct pglist_data *node_data[MAX_NUMNODES__read_mostly
 
s16 __apicid_to_node[MAX_LOCAL_APIC__cpuinitdata
 
cpumask_var_t node_to_cpumask_map [MAX_NUMNODES]
 

Function Documentation

int __node_distance ( int  from,
int  to 
)

Definition at line 452 of file numa.c.

DEFINE_EARLY_PER_CPU ( int  ,
x86_cpu_to_node_map  ,
NUMA_NO_NODE   
)
early_param ( "numa"  ,
numa_setup   
)
EXPORT_EARLY_PER_CPU_SYMBOL ( x86_cpu_to_node_map  )
EXPORT_SYMBOL ( node_data  )
EXPORT_SYMBOL ( node_to_cpumask_map  )
EXPORT_SYMBOL ( __node_distance  )
void __init init_cpu_to_node ( void  )

Definition at line 687 of file numa.c.

void __cpuinit numa_add_cpu ( int  cpu)

Definition at line 708 of file numa.c.

int __init numa_add_memblk ( int  nid,
u64  start,
u64  end 
)

numa_add_memblk - Add one numa_memblk to numa_meminfo : NUMA node ID of the new memblk : Start address of the new memblk : End address of the new memblk

Add a new memblk to the default numa_meminfo.

RETURNS: 0 on success, -errno on failure.

Definition at line 187 of file numa.c.

int __init numa_cleanup_meminfo ( struct numa_meminfo mi)

numa_cleanup_meminfo - Cleanup a numa_meminfo : numa_meminfo to clean up

Sanitize by merging and removing unncessary memblks. Also check for conflicts and clear unused memblks.

RETURNS: 0 on success, -errno on failure.

Definition at line 260 of file numa.c.

void __cpuinit numa_clear_node ( int  cpu)

Definition at line 104 of file numa.c.

int __cpuinit numa_cpu_node ( int  cpu)

Definition at line 63 of file numa.c.

void __cpuinit numa_remove_cpu ( int  cpu)

Definition at line 713 of file numa.c.

void __init numa_remove_memblk_from ( int  idx,
struct numa_meminfo mi 
)

numa_remove_memblk_from - Remove one numa_memblk from a numa_meminfo : Index of memblk to remove : numa_meminfo to remove memblk from

Remove 'th numa_memblk from by shifting ->blk[] and decrementing ->nr_blks.

Definition at line 169 of file numa.c.

void __init numa_reset_distance ( void  )

numa_reset_distance - Reset NUMA distance table

The current table is freed. The next numa_set_distance() call will create a new one.

Definition at line 361 of file numa.c.

void __init numa_set_distance ( int  from,
int  to,
int  distance 
)

numa_set_distance - Set NUMA distance from one NUMA to another : the 'from' node to set distance : the 'to' node to set distance : NUMA distance

Set the distance from node to to . If distance table doesn't exist, one which is large enough to accommodate all the currently known nodes will be created.

If such table cannot be allocated, a warning is printed and further calls are ignored until the distance table is reset with numa_reset_distance().

If or is higher than the highest known node or lower than zero at the time of table creation or doesn't make sense, the call is ignored. This is to allow simplification of specific NUMA config implementations.

Definition at line 430 of file numa.c.

void __cpuinit numa_set_node ( int  cpu,
int  node 
)

Definition at line 81 of file numa.c.

void __init setup_node_to_cpumask_map ( void  )

Definition at line 116 of file numa.c.

void __init x86_numa_init ( void  )

x86_numa_init - Initialize NUMA

Try each configured NUMA initialization method until one succeeds. The last fallback is dummy single node config encomapssing whole memory and never fails.

Definition at line 635 of file numa.c.

Variable Documentation

s16 __apicid_to_node [MAX_LOCAL_APIC] __cpuinitdata
Initial value:
= {
}

Definition at line 59 of file numa.c.

Definition at line 24 of file numa.c.

Definition at line 26 of file numa.c.

cpumask_var_t node_to_cpumask_map[MAX_NUMNODES]

Definition at line 72 of file numa.c.

int __initdata numa_off

Definition at line 23 of file numa.c.