aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/mm
diff options
context:
space:
mode:
authorKefeng Wang <wangkefeng.wang@huawei.com>2016-09-01 02:54:59 -0400
committerWill Deacon <will.deacon@arm.com>2016-09-09 09:59:09 -0400
commitf11c7bacd5941fcfc5e9dd3bb0362e8a2eec4722 (patch)
treefe8b0de1bdb0790fa58f0d326fab8bb652aa53e1 /arch/arm64/mm
parentad02180515d4856702bc656f754e9df83ab0345b (diff)
arm64: numa: Use pr_fmt()
Use pr_fmt to prefix kernel output, and remove duplicated msg of NUMA turned off. Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/mm')
-rw-r--r--arch/arm64/mm/numa.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c
index d97c6e246fb2..0e75b537de0c 100644
--- a/arch/arm64/mm/numa.c
+++ b/arch/arm64/mm/numa.c
@@ -17,6 +17,8 @@
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */ 18 */
19 19
20#define pr_fmt(fmt) "NUMA: " fmt
21
20#include <linux/acpi.h> 22#include <linux/acpi.h>
21#include <linux/bootmem.h> 23#include <linux/bootmem.h>
22#include <linux/memblock.h> 24#include <linux/memblock.h>
@@ -38,10 +40,9 @@ static __init int numa_parse_early_param(char *opt)
38{ 40{
39 if (!opt) 41 if (!opt)
40 return -EINVAL; 42 return -EINVAL;
41 if (!strncmp(opt, "off", 3)) { 43 if (!strncmp(opt, "off", 3))
42 pr_info("%s\n", "NUMA turned off");
43 numa_off = true; 44 numa_off = true;
44 } 45
45 return 0; 46 return 0;
46} 47}
47early_param("numa", numa_parse_early_param); 48early_param("numa", numa_parse_early_param);
@@ -110,7 +111,7 @@ static void __init setup_node_to_cpumask_map(void)
110 set_cpu_numa_node(cpu, NUMA_NO_NODE); 111 set_cpu_numa_node(cpu, NUMA_NO_NODE);
111 112
112 /* cpumask_of_node() will now work */ 113 /* cpumask_of_node() will now work */
113 pr_debug("NUMA: Node to cpumask map for %d nodes\n", nr_node_ids); 114 pr_debug("Node to cpumask map for %d nodes\n", nr_node_ids);
114} 115}
115 116
116/* 117/*
@@ -145,13 +146,13 @@ int __init numa_add_memblk(int nid, u64 start, u64 end)
145 146
146 ret = memblock_set_node(start, (end - start), &memblock.memory, nid); 147 ret = memblock_set_node(start, (end - start), &memblock.memory, nid);
147 if (ret < 0) { 148 if (ret < 0) {
148 pr_err("NUMA: memblock [0x%llx - 0x%llx] failed to add on node %d\n", 149 pr_err("memblock [0x%llx - 0x%llx] failed to add on node %d\n",
149 start, (end - 1), nid); 150 start, (end - 1), nid);
150 return ret; 151 return ret;
151 } 152 }
152 153
153 node_set(nid, numa_nodes_parsed); 154 node_set(nid, numa_nodes_parsed);
154 pr_info("NUMA: Adding memblock [0x%llx - 0x%llx] on node %d\n", 155 pr_info("Adding memblock [0x%llx - 0x%llx] on node %d\n",
155 start, (end - 1), nid); 156 start, (end - 1), nid);
156 return ret; 157 return ret;
157} 158}
@@ -166,19 +167,18 @@ static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn)
166 void *nd; 167 void *nd;
167 int tnid; 168 int tnid;
168 169
169 pr_info("NUMA: Initmem setup node %d [mem %#010Lx-%#010Lx]\n", 170 pr_info("Initmem setup node %d [mem %#010Lx-%#010Lx]\n",
170 nid, start_pfn << PAGE_SHIFT, 171 nid, start_pfn << PAGE_SHIFT, (end_pfn << PAGE_SHIFT) - 1);
171 (end_pfn << PAGE_SHIFT) - 1);
172 172
173 nd_pa = memblock_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid); 173 nd_pa = memblock_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid);
174 nd = __va(nd_pa); 174 nd = __va(nd_pa);
175 175
176 /* report and initialize */ 176 /* report and initialize */
177 pr_info("NUMA: NODE_DATA [mem %#010Lx-%#010Lx]\n", 177 pr_info("NODE_DATA [mem %#010Lx-%#010Lx]\n",
178 nd_pa, nd_pa + nd_size - 1); 178 nd_pa, nd_pa + nd_size - 1);
179 tnid = early_pfn_to_nid(nd_pa >> PAGE_SHIFT); 179 tnid = early_pfn_to_nid(nd_pa >> PAGE_SHIFT);
180 if (tnid != nid) 180 if (tnid != nid)
181 pr_info("NUMA: NODE_DATA(%d) on node %d\n", nid, tnid); 181 pr_info("NODE_DATA(%d) on node %d\n", nid, tnid);
182 182
183 node_data[nid] = nd; 183 node_data[nid] = nd;
184 memset(NODE_DATA(nid), 0, sizeof(pg_data_t)); 184 memset(NODE_DATA(nid), 0, sizeof(pg_data_t));
@@ -235,8 +235,7 @@ static int __init numa_alloc_distance(void)
235 numa_distance[i * numa_distance_cnt + j] = i == j ? 235 numa_distance[i * numa_distance_cnt + j] = i == j ?
236 LOCAL_DISTANCE : REMOTE_DISTANCE; 236 LOCAL_DISTANCE : REMOTE_DISTANCE;
237 237
238 pr_debug("NUMA: Initialized distance table, cnt=%d\n", 238 pr_debug("Initialized distance table, cnt=%d\n", numa_distance_cnt);
239 numa_distance_cnt);
240 239
241 return 0; 240 return 0;
242} 241}
@@ -257,20 +256,20 @@ static int __init numa_alloc_distance(void)
257void __init numa_set_distance(int from, int to, int distance) 256void __init numa_set_distance(int from, int to, int distance)
258{ 257{
259 if (!numa_distance) { 258 if (!numa_distance) {
260 pr_warn_once("NUMA: Warning: distance table not allocated yet\n"); 259 pr_warn_once("Warning: distance table not allocated yet\n");
261 return; 260 return;
262 } 261 }
263 262
264 if (from >= numa_distance_cnt || to >= numa_distance_cnt || 263 if (from >= numa_distance_cnt || to >= numa_distance_cnt ||
265 from < 0 || to < 0) { 264 from < 0 || to < 0) {
266 pr_warn_once("NUMA: Warning: node ids are out of bound, from=%d to=%d distance=%d\n", 265 pr_warn_once("Warning: node ids are out of bound, from=%d to=%d distance=%d\n",
267 from, to, distance); 266 from, to, distance);
268 return; 267 return;
269 } 268 }
270 269
271 if ((u8)distance != distance || 270 if ((u8)distance != distance ||
272 (from == to && distance != LOCAL_DISTANCE)) { 271 (from == to && distance != LOCAL_DISTANCE)) {
273 pr_warn_once("NUMA: Warning: invalid distance parameter, from=%d to=%d distance=%d\n", 272 pr_warn_once("Warning: invalid distance parameter, from=%d to=%d distance=%d\n",
274 from, to, distance); 273 from, to, distance);
275 return; 274 return;
276 } 275 }
@@ -297,7 +296,7 @@ static int __init numa_register_nodes(void)
297 /* Check that valid nid is set to memblks */ 296 /* Check that valid nid is set to memblks */
298 for_each_memblock(memory, mblk) 297 for_each_memblock(memory, mblk)
299 if (mblk->nid == NUMA_NO_NODE || mblk->nid >= MAX_NUMNODES) { 298 if (mblk->nid == NUMA_NO_NODE || mblk->nid >= MAX_NUMNODES) {
300 pr_warn("NUMA: Warning: invalid memblk node %d [mem %#010Lx-%#010Lx]\n", 299 pr_warn("Warning: invalid memblk node %d [mem %#010Lx-%#010Lx]\n",
301 mblk->nid, mblk->base, 300 mblk->nid, mblk->base,
302 mblk->base + mblk->size - 1); 301 mblk->base + mblk->size - 1);
303 return -EINVAL; 302 return -EINVAL;
@@ -369,8 +368,8 @@ static int __init dummy_numa_init(void)
369 368
370 if (numa_off) 369 if (numa_off)
371 pr_info("NUMA disabled\n"); /* Forced off on command line. */ 370 pr_info("NUMA disabled\n"); /* Forced off on command line. */
372 pr_info("NUMA: Faking a node at [mem %#018Lx-%#018Lx]\n", 371 pr_info("Faking a node at [mem %#018Lx-%#018Lx]\n",
373 0LLU, PFN_PHYS(max_pfn) - 1); 372 0LLU, PFN_PHYS(max_pfn) - 1);
374 373
375 for_each_memblock(memory, mblk) { 374 for_each_memblock(memory, mblk) {
376 ret = numa_add_memblk(0, mblk->base, mblk->base + mblk->size); 375 ret = numa_add_memblk(0, mblk->base, mblk->base + mblk->size);