diff options
author | Tejun Heo <tj@kernel.org> | 2011-03-02 11:32:47 +0100 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2011-03-02 16:34:21 +0100 |
commit | eb8c1e2c830fc25c93bc94e215ed387fe142a98d (patch) | |
tree | 21c87bb959e98a1639f6de575f8a630c4cb4e261 /arch/x86/mm/numa_64.c | |
parent | ce0033307f1b45e23e0c149f56ea4855eb4687ce (diff) | |
download | talos-obmc-linux-eb8c1e2c830fc25c93bc94e215ed387fe142a98d.tar.gz talos-obmc-linux-eb8c1e2c830fc25c93bc94e215ed387fe142a98d.zip |
x86-64, NUMA: Better explain numa_distance handling
Handling of out-of-bounds distances and allocation failure can use
better documentation. Add it.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Acked-by: David Rientjes <rientjes@google.com>
Diffstat (limited to 'arch/x86/mm/numa_64.c')
-rw-r--r-- | arch/x86/mm/numa_64.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index 541746fdeb4b..74064e8ae79f 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c @@ -392,11 +392,12 @@ void __init numa_reset_distance(void) { size_t size = numa_distance_cnt * numa_distance_cnt * sizeof(numa_distance[0]); + /* numa_distance could be 1LU marking allocation failure, test cnt */ if (numa_distance_cnt) memblock_x86_free_range(__pa(numa_distance), __pa(numa_distance) + size); numa_distance_cnt = 0; - numa_distance = NULL; + numa_distance = NULL; /* enable table creation */ } static int __init numa_alloc_distance(void) @@ -447,6 +448,14 @@ static int __init numa_alloc_distance(void) * Set the distance from node @from to @to to @distance. If distance table * doesn't exist, one which is large enough to accomodate 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 @from or @to is higher than the highest known node at the time of + * table creation or @distance doesn't make sense, the call is ignored. + * This is to allow simplification of specific NUMA config implementations. */ void __init numa_set_distance(int from, int to, int distance) { |