Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932408AbcCHIfF (ORCPT ); Tue, 8 Mar 2016 03:35:05 -0500 Received: from mail-bn1bon0080.outbound.protection.outlook.com ([157.56.111.80]:42256 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753805AbcCHIe4 (ORCPT ); Tue, 8 Mar 2016 03:34:56 -0500 Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=caviumnetworks.com; Date: Tue, 8 Mar 2016 09:34:36 +0100 From: Robert Richter To: Ganapatrao Kulkarni CC: David Daney , Mark Rutland , "devicetree@vger.kernel.org" , , David Daney , Pawel Moll , Ian Campbell , Matt Fleming , Catalin Marinas , Ard Biesheuvel , Will Deacon , "linux-kernel@vger.kernel.org" , Rob Herring , David Daney , Kumar Gala , Grant Likely , Ganapatrao Kulkarni , Frank Rowand , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH v14 2/6] Documentation, dt, numa: dt bindings for NUMA. Message-ID: <20160308083436.GC24726@rric.localdomain> References: <1457049339-23351-1-git-send-email-ddaney.cavm@gmail.com> <1457049339-23351-3-git-send-email-ddaney.cavm@gmail.com> <20160307192220.GA1535@rric.localdomain> <56DDDAC9.1010600@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [78.53.84.49] X-ClientProxiedBy: DB4PR01CA0039.eurprd01.prod.exchangelabs.com (10.242.152.29) To CY1PR0701MB1615.namprd07.prod.outlook.com (25.163.20.152) X-MS-Office365-Filtering-Correlation-Id: f2f34492-2e87-4714-e4fa-08d3472c8534 X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1615;2:jIpRmbvz05RZaIaqU/DGXU+L+s/5++u1mQ+kmreZTS7hp+np/1dgqhylrBggwWC6+lxdj/CH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14uIY/JfhJZll2o710BTGLxI4tL6FiZMOIceucnBD9g5dFKIoAxsWVvHaUAJ5FyQ2QhTBGwmzojmAt7ScMDMxHE89UD1QtNpCYysz/N79EEaa607GLEpQi1s6JhvpsjXgqEgV9q11k4b6Zz2q7mKz5e8lyoMmjNtON5ZMmQyIbNeaM5Lai6Zhvrt5byzba+5FEVFdLz2OnPcDTVFW6FQX9FfEiNj5SOhhZluIuDvhVQjuuEdC+lvxW/0Oo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001);SRVR:CY1PR0701MB1615;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1615; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1615;4:3Tl9Gu35TUS5l+Fh2NJyS3O9DHAIbLHyw0rQy8NDoyfBV64mOmrE7N5ReCvElrRCfa6+4i84KujZTveYyiQjC5dNKjgjlP8Bu9SMZlqoDYWTX71bROykExgx7hBMbx+sFT2W5eDUoH55Zm+QaR+uzRf9df9B9IcZVi0c9edQCD21ic9DybeI4alhjWEq8NRmGt3/cy/ZxWiNhqkQzYrbrK22XcGp08qTh7wX+Qk8V5CKWRwJGw673A+d/1L8hkoq/QLup3M/jca9kSTZjMSq40wKdrvfW+EXJlwthYchXKGHUPzAF3mN+RZ5pI4V1Lhf+AkVHZh6gH/HZSOl+CF/JnlxUw+k9uN73YhXLzzEOCOkW6XffTYNRKhBrt0bQ3O2 X-Forefront-PRVS: 08756AC3C8 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(24454002)(479174004)(57704003)(377454003)(2950100001)(19580405001)(42186005)(5008740100001)(76176999)(50986999)(77096005)(33656002)(586003)(4326007)(189998001)(2906002)(110136002)(23726003)(3846002)(87976001)(50466002)(54356999)(19580395003)(122386002)(40100003)(4001350100001)(92566002)(66066001)(93886004)(86362001)(47776003)(5004730100002)(97756001)(1411001)(6116002)(83506001)(81166005)(1076002)(1096002)(46406003);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0701MB1615;H:rric.localdomain;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0701MB1615;23:kkl1EAqS6POOGSM2ZyxiKS0Dgs5f6OZ1OIZAnqq?= =?us-ascii?Q?zm1Ivg5ssLiEGPyx4ek71h01OGYsT32UfAo2yuF9fvt/TnQFNoq5fah8AXxD?= =?us-ascii?Q?yzl7WBVOhJ6XEbF/LCwA2d80m0anrYRvos4740nxz6dg/7reYpqQjtONIjTQ?= =?us-ascii?Q?2Du3UHzxQqkiI33d8o417YyvddtJjAPEOut6cv/COKfFmmz7FBxK1LXKkOOI?= =?us-ascii?Q?VtznbN4bDk8yZ4AslKyvtAJtEaVcQ/AkP1l/LY7CimVA6pBeagdbPKmO9Rbx?= =?us-ascii?Q?vDdRSmssOyRnbOHLMlA6+W96bHMc4knc/gnBIpddato8+8zIRl3YQ5019Yrt?= =?us-ascii?Q?Kvh3fl8hTAZbRB6xKopgV38vxZQhc+B+osqU03LgLUXwdqyxbLgNpbeN/g4y?= =?us-ascii?Q?hhCwa8gx6yx3dzUVllHx+KGDSy4bR+KeZJUVoI/utBSwPEpWMAtsuyuEYAYZ?= =?us-ascii?Q?1orG5fx2jmE/OpSU3oe559qe2YTMQ09rCcLkUiDZyazbP7VBwxgmT1x1/1fQ?= =?us-ascii?Q?UpIkEiu1tu/APqXzTh6TOQgJnUsjpwjXRdqNaKU/UtZn1QtufZggaOaeOXeY?= =?us-ascii?Q?usXbE2bJT8ND4sGQQ1SDsqcpQ8AxS9rlSlHtt13x2RNBAQPbJUy84P3OHF6G?= =?us-ascii?Q?40gDjgUj8vzKOzf2qJOOF1gPRhEszlUk1KBe8oxmtJWRtJw+Ln1tiUOWOORi?= =?us-ascii?Q?n0Gv4x0aFf79QuCIAjSKHv9HZ0mNam/bhSNLzBT8EfgWeB3tytfIp1m755KZ?= =?us-ascii?Q?lYpWqnLenxwEVUgEM4qRAnA4yCMvPYeoF0poVebYYQ3B6PdmuwlpItgUfkeQ?= =?us-ascii?Q?fDnRQao6gzRcdL8N+uEZLk4bl7oCLyrpp8BU75II9pxHu72YoEhew3TLSQsI?= =?us-ascii?Q?CX118zCp/PfWqoyqgjWVRh2rw/dpWYAOpMoxRFQjduQp9+E6FJZYwBVjEW28?= =?us-ascii?Q?Wu75R2w966zlXyH+lWPhPRsOY/zvs14Cjfrecu/n+SdWzZ4VYI5WI4CA5Pvj?= =?us-ascii?Q?iEkimi7W6hdHfL0ZxSrklTV5T4Und49nufJ+F7EsyZEx5/7Ag3+JtZQ8OZam?= =?us-ascii?Q?XlzSF6/yqMRheVVuXxhv/yfsRO/VrG+whkC37bQOuV8S9fqXZsw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1615;5:UXHfYQsSAS3woVWhxSSXiD8pDHwcjCzL6+2dFnV+3IHQsAkjtqCujPE5GcfxMH5b9HX+JXKZ5S/tQanMeBsYHc3RnOYm05F1v4CNsFXbNqDeUHelgYD5OBypXhuGVjPQCj3bkkWO/tr4OhC8qJBPjQ==;24:W7SAkG6NdLJl15vRHoOR/SPItV8oDQvtexkGrS22RPgPMQRQy8Fe8XroziDe2cTfgFIQN769Mf98f/BUFM12XQdXJnJ/ZOOw3z++lauUAWg= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2016 08:34:48.3027 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1615 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4303 Lines: 117 On 08.03.16 10:31:33, Ganapatrao Kulkarni wrote: > On Tue, Mar 8, 2016 at 1:17 AM, David Daney wrote: > > On 03/07/2016 11:22 AM, Robert Richter wrote: > >> > >> On 03.03.16 15:55:35, David Daney wrote: > >>> > >>> From: Ganapatrao Kulkarni > >>> > >>> Add DT bindings for numa mapping of memory, CPUs and IOs. > >>> > >>> Reviewed-by: Robert Richter > >>> Signed-off-by: Ganapatrao Kulkarni > >>> Signed-off-by: David Daney > >>> --- > >>> Documentation/devicetree/bindings/numa.txt | 272 > >>> +++++++++++++++++++++++++++++ > >>> 1 file changed, 272 insertions(+) > >>> create mode 100644 Documentation/devicetree/bindings/numa.txt > >>> > >>> diff --git a/Documentation/devicetree/bindings/numa.txt > >>> b/Documentation/devicetree/bindings/numa.txt > >>> new file mode 100644 > >>> index 0000000..ec5ed7c > >>> --- /dev/null > >>> +++ b/Documentation/devicetree/bindings/numa.txt > >> > >> > >>> > >>> +============================================================================== > >>> +3 - distance-map > >>> > >>> +============================================================================== > >>> + > >>> +The device tree node distance-map describes the relative > >>> +distance (memory latency) between all numa nodes. > >>> + > >>> +- compatible : Should at least contain "numa-distance-map-v1". > >>> + > >>> +- distance-matrix > >>> + This property defines a matrix to describe the relative distances > >>> + between all numa nodes. > >>> + It is represented as a list of node pairs and their relative distance. > >>> + > >>> + Note: > >>> + 1. Each entry represents distance from first node to second node. > >>> + The distances are equal in either direction. > >>> + 2. The distance from a node to self (local distance) is > >>> represented > >>> + with value 10 and all internode distance should be represented > >>> with > >>> + a value greater than 10. > >>> + 3. distance-matrix should have entries in lexicographical > >>> ascending > >>> + order of nodes. > >>> + 4. There must be only one device node distance-map which must > >>> reside in the root node. > >> > >> > >> There is no note that this one is optional, but is it right? The > >> default is 10 for local and 20 for remote connections. > >> > > > > Do we need to explicitly state that it is optional? Many node types are > > optional, and their binding specifications don't really talk about their > > being optional. > > > > If the node is present then it has the meaning specified. > > > > If the node is *not* present, then the special meaning described in the > > bindings document does not apply. > > > > In the case of NUMA, this means that all memory is equally distant (i.e. it > > is *Uniform*), and we are not talking about a *Non* *Uniform* Memory > > Architecture (NUMA) system. > > > > > >> If so, then ... > >> > >> static int __init of_numa_parse_distance_map(void) > >> { > >> int ret = -EINVAL; > >> struct device_node *np = of_find_node_by_path("/distance-map"); > >> > >> if (!np) > >> return ret; > >> > >> must return 0 instead of -EINVAL here. > > > > > > No, I don't think doing that would be correct. > > > > If there is no "distance-map", then of_numa_init() returns the error code. > > This causes the code in arch/arm64/kernel/numa.c to fall back to the > > non-NUMA "dummy_numa" case. Which means distance-map is not optional for numa. > IMO, return 0 will allow 2 node system to have distance-map optional. > by default node distance is set to 10 for local node and for remote node is 20 > and this will suffice the need of 2 node system. > by returning EINVAL, we are forcing 2 node system (and even for > systems which has equal remote distances) > to define distance-map. This is exaclty the problem. numa_init() fails if there is no distance-map node. > > By adding your Reviewed-by: Robert Richter tag to > > patch 5/6, where we select between "real" and "dummy_numa", I had assumed > > that you agreed with this approach. This is from v6: if (strcmp(uname, "distance-map") != 0) return 0; -Robert