From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754582AbcEZQfM (ORCPT ); Thu, 26 May 2016 12:35:12 -0400 Received: from smtprelay0169.hostedemail.com ([216.40.44.169]:55527 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750985AbcEZQfJ (ORCPT ); Thu, 26 May 2016 12:35:09 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::::::::::,RULES_HIT:2:41:69:355:379:541:599:800:960:967:973:988:989:1260:1263:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1535:1593:1594:1730:1747:1777:1792:2393:2525:2553:2560:2563:2682:2685:2693:2828:2859:2892:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3165:3355:3622:3865:3866:3867:3868:3870:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4049:4118:4250:4321:5007:6119:6742:7875:7903:7904:8599:8603:9025:9388:9855:10004:10848:10920:11026:11232:11473:11658:11783:11914:12043:12291:12296:12438:12517:12519:12555:12679:12683:12740:13439:13894:13972:14659:21080:21324:21433:30012:30054:30056:30070:30075:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: net37_497fcda32b43f X-Filterd-Recvd-Size: 7657 Message-ID: <1464280503.16344.40.camel@perches.com> Subject: Re: [PATCH 3/3] arm64/numa: fix type info From: Joe Perches To: Ganapatrao Kulkarni , Zhen Lei Cc: Catalin Marinas , Will Deacon , linux-arm-kernel , Ganapatrao Kulkarni , Robert Richter , David Daney , Rob Herring , Frank Rowand , Grant Likely , devicetree , linux-kernel , Xinwei Hu , Zefan Li , Hanjun Guo , Tianhong Ding Date: Thu, 26 May 2016 09:35:03 -0700 In-Reply-To: References: <1464230639-9852-1-git-send-email-thunder.leizhen@huawei.com> <1464230639-9852-3-git-send-email-thunder.leizhen@huawei.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2016-05-26 at 09:22 -0700, Ganapatrao Kulkarni wrote: > On Wed, May 25, 2016 at 7:43 PM, Zhen Lei wrote: > > numa_init(of_numa_init) may returned error because of numa configuration > > error. So "No NUMA configuration found" is inaccurate. In fact, specific > > configuration error information can be immediately printed by the > > testing branch. So "No NUMA..." only needs to be printed when numa_off. [] > > diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c [] > > @@ -362,7 +362,8 @@ static int __init dummy_numa_init(void) > >         int ret; > >         struct memblock_region *mblk; > > > > -       pr_info("%s\n", "No NUMA configuration found"); > > +       if (numa_off) > IIRC, it should be > if (!numa_off) > we want to print this message when we failed to find proper numa configuration. > when numa_off is set, we will not look for any numa configuration. > > > > > +               pr_info("%s\n", "No NUMA configuration found"); trivia: Using printk("%s\n", "string") just makes the object code larger for no particular benefit. pr_info("No NUMA configuration found\n"); would be smaller, faster and more intelligible for humans too. Maybe something like this: ---  arch/arm64/mm/numa.c | 41 ++++++++++++++++++++---------------------  1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c index 98dc104..2042452 100644 --- a/arch/arm64/mm/numa.c +++ b/arch/arm64/mm/numa.c @@ -17,6 +17,8 @@   * along with this program.  If not, see .   */   +#define pr_fmt(fmt) "NUMA: " fmt +  #include  #include  #include @@ -36,7 +38,7 @@ static __init int numa_parse_early_param(char *opt)   if (!opt)   return -EINVAL;   if (!strncmp(opt, "off", 3)) { - pr_info("%s\n", "NUMA turned off"); + pr_info("NUMA turned off\n");   numa_off = 1;   }   return 0; @@ -107,7 +109,7 @@ static void __init setup_node_to_cpumask_map(void)   set_cpu_numa_node(cpu, NUMA_NO_NODE);     /* cpumask_of_node() will now work */ - pr_debug("NUMA: Node to cpumask map for %d nodes\n", nr_node_ids); + pr_debug("Node to cpumask map for %d nodes\n", nr_node_ids);  }    /* @@ -142,14 +144,14 @@ int __init numa_add_memblk(int nid, u64 start, u64 size)     ret = memblock_set_node(start, size, &memblock.memory, nid);   if (ret < 0) { - pr_err("NUMA: memblock [0x%llx - 0x%llx] failed to add on node %d\n", - start, (start + size - 1), nid); + pr_err("memblock [0x%llx - 0x%llx] failed to add on node %d\n", +        start, (start + size - 1), nid);   return ret;   }     node_set(nid, numa_nodes_parsed); - pr_info("NUMA: Adding memblock [0x%llx - 0x%llx] on node %d\n", - start, (start + size - 1), nid); + pr_info("Adding memblock [0x%llx - 0x%llx] on node %d\n", + start, (start + size - 1), nid);   return ret;  }   @@ -163,19 +165,18 @@ static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn)   void *nd;   int tnid;   - pr_info("NUMA: Initmem setup node %d [mem %#010Lx-%#010Lx]\n", - nid, start_pfn << PAGE_SHIFT, - (end_pfn << PAGE_SHIFT) - 1); + pr_info("Initmem setup node %d [mem %#010Lx-%#010Lx]\n", + nid, start_pfn << PAGE_SHIFT, (end_pfn << PAGE_SHIFT) - 1);     nd_pa = memblock_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid);   nd = __va(nd_pa);     /* report and initialize */ - pr_info("NUMA: NODE_DATA [mem %#010Lx-%#010Lx]\n", + pr_info("NODE_DATA [mem %#010Lx-%#010Lx]\n",   nd_pa, nd_pa + nd_size - 1);   tnid = early_pfn_to_nid(nd_pa >> PAGE_SHIFT);   if (tnid != nid) - pr_info("NUMA: NODE_DATA(%d) on node %d\n", nid, tnid); + pr_info("NODE_DATA(%d) on node %d\n", nid, tnid);     node_data[nid] = nd;   memset(NODE_DATA(nid), 0, sizeof(pg_data_t)); @@ -232,8 +233,7 @@ static int __init numa_alloc_distance(void)   numa_distance[i * numa_distance_cnt + j] = i == j ?   LOCAL_DISTANCE : REMOTE_DISTANCE;   - pr_debug("NUMA: Initialized distance table, cnt=%d\n", - numa_distance_cnt); + pr_debug("Initialized distance table, cnt=%d\n", numa_distance_cnt);     return 0;  } @@ -254,20 +254,20 @@ static int __init numa_alloc_distance(void)  void __init numa_set_distance(int from, int to, int distance)  {   if (!numa_distance) { - pr_warn_once("NUMA: Warning: distance table not allocated yet\n"); + pr_warn_once("Warning: distance table not allocated yet\n");   return;   }     if (from >= numa_distance_cnt || to >= numa_distance_cnt ||   from < 0 || to < 0) { - pr_warn_once("NUMA: Warning: node ids are out of bound, from=%d to=%d distance=%d\n", -     from, to, distance); + pr_warn_once("Warning: node ids are out of bound, from=%d to=%d distance=%d\n", +      from, to, distance);   return;   }     if ((u8)distance != distance ||       (from == to && distance != LOCAL_DISTANCE)) { - pr_warn_once("NUMA: Warning: invalid distance parameter, from=%d to=%d distance=%d\n", + pr_warn_once("Warning: invalid distance parameter, from=%d to=%d distance=%d\n",        from, to, distance);   return;   } @@ -294,7 +294,7 @@ static int __init numa_register_nodes(void)   /* Check that valid nid is set to memblks */   for_each_memblock(memory, mblk)   if (mblk->nid == NUMA_NO_NODE || mblk->nid >= MAX_NUMNODES) { - pr_warn("NUMA: Warning: invalid memblk node %d [mem %#010Lx-%#010Lx]\n", + pr_warn("Warning: invalid memblk node %d [mem %#010Lx-%#010Lx]\n",   mblk->nid, mblk->base,   mblk->base + mblk->size - 1);   return -EINVAL; @@ -362,9 +362,8 @@ static int __init dummy_numa_init(void)   int ret;   struct memblock_region *mblk;   - pr_info("%s\n", "No NUMA configuration found"); - pr_info("NUMA: Faking a node at [mem %#018Lx-%#018Lx]\n", -        0LLU, PFN_PHYS(max_pfn) - 1); + pr_info("No NUMA configuration found - faking a node at [mem %#018Lx-%#018Lx]\n", + 0LLU, PFN_PHYS(max_pfn) - 1);     for_each_memblock(memory, mblk) {   ret = numa_add_memblk(0, mblk->base, mblk->size);