aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-02-22 05:10:08 -0500
committerTejun Heo <tj@kernel.org>2011-02-22 05:10:08 -0500
commit90e6b677b47ff8c5ba1637941af6b9f92723b003 (patch)
tree0d1a4a2d0bc9b09e1764d2e09d875cae3e55c86e
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>
-rw-r--r--arch/x86/mm/numa_64.c50
-rw-r--r--arch/x86/mm/numa_emulation.c29
2 files changed, 69 insertions, 10 deletions
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index 45a361b16a59..848381bdd358 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -205,6 +205,14 @@ static int __init numa_add_memblk_to(int nid, u64 start, u64 end,
205 return 0; 205 return 0;
206} 206}
207 207
208/**
209 * numa_remove_memblk_from - Remove one numa_memblk from a numa_meminfo
210 * @idx: Index of memblk to remove
211 * @mi: numa_meminfo to remove memblk from
212 *
213 * Remove @idx'th numa_memblk from @mi by shifting @mi->blk[] and
214 * decrementing @mi->nr_blks.
215 */
208void __init numa_remove_memblk_from(int idx, struct numa_meminfo *mi) 216void __init numa_remove_memblk_from(int idx, struct numa_meminfo *mi)
209{ 217{
210 mi->nr_blks--; 218 mi->nr_blks--;
@@ -212,6 +220,17 @@ void __init numa_remove_memblk_from(int idx, struct numa_meminfo *mi)
212 (mi->nr_blks - idx) * sizeof(mi->blk[0])); 220 (mi->nr_blks - idx) * sizeof(mi->blk[0]));
213} 221}
214 222
223/**
224 * numa_add_memblk - Add one numa_memblk to numa_meminfo
225 * @nid: NUMA node ID of the new memblk
226 * @start: Start address of the new memblk
227 * @end: End address of the new memblk
228 *
229 * Add a new memblk to the default numa_meminfo.
230 *
231 * RETURNS:
232 * 0 on success, -errno on failure.
233 */
215int __init numa_add_memblk(int nid, u64 start, u64 end) 234int __init numa_add_memblk(int nid, u64 start, u64 end)
216{ 235{
217 return numa_add_memblk_to(nid, start, end, &numa_meminfo); 236 return numa_add_memblk_to(nid, start, end, &numa_meminfo);
@@ -263,6 +282,16 @@ setup_node_bootmem(int nodeid, unsigned long start, unsigned long end)
263 node_set_online(nodeid); 282 node_set_online(nodeid);
264} 283}
265 284
285/**
286 * numa_cleanup_meminfo - Cleanup a numa_meminfo
287 * @mi: numa_meminfo to clean up
288 *
289 * Sanitize @mi by merging and removing unncessary memblks. Also check for
290 * conflicts and clear unused memblks.
291 *
292 * RETURNS:
293 * 0 on success, -errno on failure.
294 */
266int __init numa_cleanup_meminfo(struct numa_meminfo *mi) 295int __init numa_cleanup_meminfo(struct numa_meminfo *mi)
267{ 296{
268 const u64 low = 0; 297 const u64 low = 0;
@@ -353,9 +382,11 @@ static void __init numa_nodemask_from_meminfo(nodemask_t *nodemask,
353 node_set(mi->blk[i].nid, *nodemask); 382 node_set(mi->blk[i].nid, *nodemask);
354} 383}
355 384
356/* 385/**
357 * Reset distance table. The current table is freed. The next 386 * numa_reset_distance - Reset NUMA distance table
358 * numa_set_distance() call will create a new one. 387 *
388 * The current table is freed. The next numa_set_distance() call will
389 * create a new one.
359 */ 390 */
360void __init numa_reset_distance(void) 391void __init numa_reset_distance(void)
361{ 392{
@@ -370,10 +401,15 @@ void __init numa_reset_distance(void)
370 numa_distance = NULL; 401 numa_distance = NULL;
371} 402}
372 403
373/* 404/**
374 * Set the distance between node @from to @to to @distance. If distance 405 * numa_set_distance - Set NUMA distance from one NUMA to another
375 * table doesn't exist, one which is large enough to accomodate all the 406 * @from: the 'from' node to set distance
376 * currently known nodes will be created. 407 * @to: the 'to' node to set distance
408 * @distance: NUMA distance
409 *
410 * Set the distance from node @from to @to to @distance. If distance table
411 * doesn't exist, one which is large enough to accomodate all the currently
412 * known nodes will be created.
377 */ 413 */
378void __init numa_set_distance(int from, int to, int distance) 414void __init numa_set_distance(int from, int to, int distance)
379{ 415{
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,
267 return 0; 267 return 0;
268} 268}
269 269
270/* 270/**
271 * Sets up the system RAM area from start_pfn to last_pfn according to the 271 * numa_emulation - Emulate NUMA nodes
272 * numa=fake command-line option. 272 * @numa_meminfo: NUMA configuration to massage
273 * @numa_dist_cnt: The size of the physical NUMA distance table
274 *
275 * Emulate NUMA nodes according to the numa=fake kernel parameter.
276 * @numa_meminfo contains the physical memory configuration and is modified
277 * to reflect the emulated configuration on success. @numa_dist_cnt is
278 * used to determine the size of the physical distance table.
279 *
280 * On success, the following modifications are made.
281 *
282 * - @numa_meminfo is updated to reflect the emulated nodes.
283 *
284 * - __apicid_to_node[] is updated such that APIC IDs are mapped to the
285 * emulated nodes.
286 *
287 * - NUMA distance table is rebuilt to represent distances between emulated
288 * nodes. The distances are determined considering how emulated nodes
289 * are mapped to physical nodes and match the actual distances.
290 *
291 * - emu_nid_to_phys[] reflects how emulated nodes are mapped to physical
292 * nodes. This is used by numa_add_cpu() and numa_remove_cpu().
293 *
294 * If emulation is not enabled or fails, emu_nid_to_phys[] is filled with
295 * identity mapping and no other modification is made.
273 */ 296 */
274void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt) 297void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt)
275{ 298{