Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753398AbcCGThf (ORCPT ); Mon, 7 Mar 2016 14:37:35 -0500 Received: from mail-by2on0081.outbound.protection.outlook.com ([207.46.100.81]:20644 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752989AbcCGThZ (ORCPT ); Mon, 7 Mar 2016 14:37:25 -0500 Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=caviumnetworks.com; Date: Mon, 7 Mar 2016 20:22:20 +0100 From: Robert Richter To: David Daney CC: Will Deacon , , Rob Herring , Frank Rowand , Grant Likely , Pawel Moll , Ian Campbell , Kumar Gala , Ganapatrao Kulkarni , Ard Biesheuvel , Matt Fleming , Mark Rutland , Catalin Marinas , , , , David Daney Subject: Re: [PATCH v14 2/6] Documentation, dt, numa: dt bindings for NUMA. Message-ID: <20160307192220.GA1535@rric.localdomain> References: <1457049339-23351-1-git-send-email-ddaney.cavm@gmail.com> <1457049339-23351-3-git-send-email-ddaney.cavm@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1457049339-23351-3-git-send-email-ddaney.cavm@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [78.53.84.176] X-ClientProxiedBy: VI1PR02CA0011.eurprd02.prod.outlook.com (25.162.7.149) To CY1PR0701MB1615.namprd07.prod.outlook.com (25.163.20.152) X-MS-Office365-Filtering-Correlation-Id: 92711858-a75f-4786-c90b-08d346bdd7fe X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1615;2:XLrxtszvuRGkpQIXKCPGUIlg7Ul1rFIuTTAivI0uPFEIJtgNGAm9/icK0Qo/wY2Pno4235DYZh9mT1h2QIDkiivQA7IBbb0dgyNljHS+sTWOuKpNRZbvA4KdOQMlp1+3nMwhsMzk7B8gnxBu6MDzXzzOMvBMKZMCnx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gnPqrCK3Vcb+vrK2d0nJB7qPawV6YSLQbqbRnnrN0jd7NnojM20cj1aKfP5ZYYMRSoA/WVURwxSauAXlls7MEoKsZSGeVAcMqRZN0eqSgX7lO9l0q7H8IPFxttkkp1dSeaLcQATlKuSaoHA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);SRVR:CY1PR0701MB1615;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1615; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1615;4:JjhYP4RrN+u9n132GFJKYJLD/69PG17SDiWOOPfGuuFsKLTt2V4p5N7v/A+9gDwas+Fa1QN9eRLqE64/VVchyEpGRXMhp/c92KRgi2rEIBfk26HipCIpCfI4+m8L1LSs1l+ImjYGbFRXKCBzckwbKb+01/fTXSz2uaXpLQHaHndRiVbx5T9o5bbAIyQK0zIanDX72C/5UA6iArFWFECjrpMv2ZQoSPS+aPEiPNXkZXHyfJULIxyIS8ghT4DgsEft9mEq+YgRaViydc1ZTVyE28BtNEi8SBwr6wv1kEQFe00JNaMKVHpKswx8keYlF9/ojsoi2ZAUeWOLHkJYkqTwiL6pTsEZWQ2VbFwozq+CT64rFm/5sPKNxufDuZDAVHIH X-Forefront-PRVS: 087474FBFA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(24454002)(47776003)(86362001)(97756001)(5004730100002)(92566002)(66066001)(122386002)(4001350100001)(40100003)(1076002)(1096002)(81166005)(46406003)(33656002)(6116002)(83506001)(76176999)(50986999)(77096005)(2950100001)(42186005)(19580405001)(5008740100001)(3846002)(19580395003)(23726003)(50466002)(87976001)(54356999)(189998001)(110136002)(2906002)(586003)(4326007);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:pOT8tAu0tC7KGhZ57uH3pkorfjl7PAVD9orKcUu?= =?us-ascii?Q?3STZmJrp6n8141Wfn2Bh2rTDPUX+CPUSOXbRkdDCMLWMY4cTM/mI/ayOLlxU?= =?us-ascii?Q?H3l4VQa3jl/rsqPArOoyNdNscg3NO+AqGBC7w4f1Za99wNeX5RS2uealfXNI?= =?us-ascii?Q?I+7NoGZYvY0QWVGCLnt2I7PFPh0DnOkudfOYmHqfPkh4DssuQ9r7Eebr7OXc?= =?us-ascii?Q?RwZYUCgYw4PxVrajNsK0nuAy4fpz3AKfH46GU0zQm5HOzdKhQ/IRYs4k94JB?= =?us-ascii?Q?WntcEwecUIQ0NlOIkSkycTrk7jN393duzOFgRQl51YIFPx16DwVi0+jNUzeI?= =?us-ascii?Q?ANUxnS4NpVQRktWxDbfDwSRptcoxJGRJRUg/Mbzc83Km1ONYYIgKbXQBbfIb?= =?us-ascii?Q?bQXE6BhEVRPMJEwPzArxwpV6REHZM/WRMRpqeym6B3UJ45guJB7AN2wEswoo?= =?us-ascii?Q?X4vslQVAXJJex5G/+h0vYMlZQYlrTO7ZD53GmzwIHToGBkNnOMh365WnVeWP?= =?us-ascii?Q?5wipUZOaNgZhoAUBA9ipyq59omE4Hr0xYWIjz3bmV3O+3Bvawnx8IBh7nBF9?= =?us-ascii?Q?BFJPnkAM2JmCiblxTfsI3f+/2LmgTjD+CUE/HXQ8DTANzL38W8J54NtqHx7l?= =?us-ascii?Q?fX5hFWLDi+dCor8SxpwtsL7XM2tIIqCdSzQciZsP9k8j95D0i8QmJAl47cFe?= =?us-ascii?Q?eisv9vu4NfN0LYvv0EoyXZIWvHXlnLVswuBdVxqXah8Vc/JHZ6W478lyRCO9?= =?us-ascii?Q?aGU08m/f+en5dBXB9dKIfHGl9afoG+Kol5ewzHUHKBlpefe5nutlGwI7otXG?= =?us-ascii?Q?56IXpX9WrijGT5Q2dRuajBD+zeCk+oBViRg4jmBXK1kEvEn7riLsmhpbkgO0?= =?us-ascii?Q?D+ywtPVm7cYXvbgsFdIWChdRFcEm8kz1vMyrTEiWj3npE4GvbFT/PM4terkO?= =?us-ascii?Q?C7Md8LZ1pCd8TyXVo3Ahmn4ROcDcC/+6SkC9lJYiexdbn5nuEjDcGrUAmcSt?= =?us-ascii?Q?+YPk=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1615;5:SGq6Z4iHM6iBLBTWQ6FV4MGBE/6kEgUtnZqD2CNoEGq0qry07ixu5eOeLk6V2Dygwhzrjr0tvaUIxY0NMR1Z96nxe+cGU+CWC5xxpLmXsaZlSMy6MoLJuIErVPqQCkbUuQlfd3eOPb6i1z/RPwYCIQ==;24:LKElPxpR+BzvUqHU8JmQYDaW6UTYsksm0g+bRi6J7MiV9ZlfZ4jS3nv7uAjbjzb2m4ZbNLZhD5nMXemxHAVstGoXxT4Fy/j0HFU9t0PzuNY= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2016 19:22:33.9156 (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: 3146 Lines: 103 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. 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. -Robert > + > +Example: > + 4 nodes connected in mesh/ring topology as below, > + > + 0_______20______1 > + | | > + | | > + 20 20 > + | | > + | | > + |_______________| > + 3 20 2 > + > + if relative distance for each hop is 20, > + then internode distance would be, > + 0 -> 1 = 20 > + 1 -> 2 = 20 > + 2 -> 3 = 20 > + 3 -> 0 = 20 > + 0 -> 2 = 40 > + 1 -> 3 = 40 > + > + and dt presentation for this distance matrix is, > + > + distance-map { > + compatible = "numa-distance-map-v1"; > + distance-matrix = <0 0 10>, > + <0 1 20>, > + <0 2 40>, > + <0 3 20>, > + <1 0 20>, > + <1 1 10>, > + <1 2 20>, > + <1 3 40>, > + <2 0 40>, > + <2 1 20>, > + <2 2 10>, > + <2 3 20>, > + <3 0 20>, > + <3 1 40>, > + <3 2 20>, > + <3 3 10>; > + };