summaryrefslogtreecommitdiff
path: root/arch/x86/mm/numa_emulation.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-02-22 11:10:08 +0100
committerTejun Heo <tj@kernel.org>2011-02-22 11:10:08 +0100
commit90e6b677b47ff8c5ba1637941af6b9f92723b003 (patch)
tree0d1a4a2d0bc9b09e1764d2e09d875cae3e55c86e /arch/x86/mm/numa_emulation.c
parentb8ef9172b2aad7eeb1fcd37a9e632c7b24da1f64 (diff)
x86-64, NUMA: Add proper function comments to global functions
Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Ingo Molnar <mingo@redhat.com>
Diffstat (limited to 'arch/x86/mm/numa_emulation.c')
-rw-r--r--arch/x86/mm/numa_emulation.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/arch/x86/mm/numa_emulation.c b/arch/x86/mm/numa_emulation.c
index 23fa2d00253a..607a2e8bc87a 100644
--- a/arch/x86/mm/numa_emulation.c
+++ b/arch/x86/mm/numa_emulation.c
@@ -267,9 +267,32 @@ static int __init split_nodes_size_interleave(struct numa_meminfo *ei,
return 0;
}
-/*
- * Sets up the system RAM area from start_pfn to last_pfn according to the
- * numa=fake command-line option.
+/**
+ * numa_emulation - Emulate NUMA nodes
+ * @numa_meminfo: NUMA configuration to massage
+ * @numa_dist_cnt: The size of the physical NUMA distance table
+ *
+ * Emulate NUMA nodes according to the numa=fake kernel parameter.
+ * @numa_meminfo contains the physical memory configuration and is modified
+ * to reflect the emulated configuration on success. @numa_dist_cnt is
+ * used to determine the size of the physical distance table.
+ *
+ * On success, the following modifications are made.
+ *
+ * - @numa_meminfo is updated to reflect the emulated nodes.
+ *
+ * - __apicid_to_node[] is updated such that APIC IDs are mapped to the
+ * emulated nodes.
+ *
+ * - NUMA distance table is rebuilt to represent distances between emulated
+ * nodes. The distances are determined considering how emulated nodes
+ * are mapped to physical nodes and match the actual distances.
+ *
+ * - emu_nid_to_phys[] reflects how emulated nodes are mapped to physical
+ * nodes. This is used by numa_add_cpu() and numa_remove_cpu().
+ *
+ * If emulation is not enabled or fails, emu_nid_to_phys[] is filled with
+ * identity mapping and no other modification is made.
*/
void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt)
{