Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753433AbcCAMVe (ORCPT ); Tue, 1 Mar 2016 07:21:34 -0500 Received: from mail-bl2on0064.outbound.protection.outlook.com ([65.55.169.64]:14608 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752026AbcCAMVb (ORCPT ); Tue, 1 Mar 2016 07:21:31 -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, 1 Mar 2016 13:21:12 +0100 From: Robert Richter To: David Daney CC: Robert Richter , Will Deacon , , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , , Ard Biesheuvel , Frank Rowand , Grant Likely , Catalin Marinas , Matt Fleming , , Ganapatrao Kulkarni , , David Daney Subject: Re: [PATCH v12 4/5] arm64, numa: Add NUMA support for arm64 platforms. Message-ID: <20160301122112.GU24726@rric.localdomain> References: <1456192703-2274-1-git-send-email-ddaney.cavm@gmail.com> <1456192703-2274-5-git-send-email-ddaney.cavm@gmail.com> <20160229173446.GG31343@rric.localdomain> <56D4D782.3010503@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <56D4D782.3010503@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [92.224.193.43] X-ClientProxiedBy: AM2PR09CA0022.eurprd09.prod.outlook.com (25.161.22.160) To BLUPR0701MB1602.namprd07.prod.outlook.com (25.163.84.151) X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1602;2:nyzd4izYw64nNEiRucqP506UPWyiR/zn2wHmj3xUuoPMuMxZ+WRoGHPZwzBHeMda9joGea617yl0YNjTp3RDCCcP+yZyzxiqrGAhUAbC53w2APDAqGgu7sUqUj8irb88ImTTnwp/Oz+ZegWzNuuWqg==;3:Etm5HOfwQqcGfacJiEje2Z3hM/+wyE4QGU3JxzlrSSg+/YkA5JNgSnfGd4v2pRYUb7U+s3u4y1Ab8ZmtVO3JOxAFMBv+OMwuGcFb6QsY2i2lY0Tk9v4uX/JhLbmACCn+;25:4NpDEzAOqIgH+5jqC5pHJSV/mIKu0r9k7VKUpgPYSJWfkXjFCe9KJwbveu9Qt0jXkX8bq2cyZBaF/0hqlOOp5YjPP3bkxs0Nb2eI5J/CbWzY6xVT8NAzU3hI47lGInxRtddGAm+kdrYQC8UVB0BGqzbF6idxj8jHDZ4vCHsRR0+nwh777ArcPp6cmNSxyCB7iZsHXYp+vmeuMGC5fkeyfLDaUbQxo1TluKDFibLUFRDla+h7a2uTlSHpIH0y0qNkDMKliUSkafScCrCwLBD2dVb9wfpivTVy1vtI64U3CVisHmdrK8Z3YUaNoljyRpqKMVLX2dOJKXPrU9CNY8nTeQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB1602; X-MS-Office365-Filtering-Correlation-Id: 3e4e2a51-57d5-406e-2a3f-08d341cc0361 X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1602;20:3de05O/Wfwy4mGkiIgmfbfYmWHtk3/gaZKwjaggNZHCJ4jne4zFm4/yTjcTs7lXoVKDBzucdEiPCaxkvKrB6iN5ws1taABqGsIXjEIfxJGiOB6OS3hUjgponm6qGJM+/sPx9vFnyruEsWipbLmsIJap7kZaTYkVSykn40kehemXUFlW7C1o/l6s6pxKAi53lkaHAoq5IWOIDd0NGgbUrPs6mPe98Pm60tZP1zl3kfnm+59nQ807ZSUsxaAlpKeGSg+bVEy3NDu+4FSnaZMFKL2g/g4/vFDrk7BOVljrGguAydskRNfw1YPdfSiZvxpmbtCa08AyPAckdbdWYAm9T7mrcFMddp69Yeeth1xZ2Xrokqg6nkp6TsUmXcMiE3BIn51p4w0gEK7EDFCxdGZWC8WCtq7O4dfdfXSuGN+IylPK/nBswz2Ro7ZsaB5dhq6wt6FGFicit6YpnIHjH/WMMdlllMMLta8gU5vTIdWbmmLkwRW8O04vAJXdQs9dh18TSUmHgf14YJYPJxNNIHRh496z7iv5R+1STRTjOipmStsfGhMTMz7FfAozSjU6uTbKFYn/yz7zps5QLxMLAkcJVjObi9jdKJ2FufTvcVG+w/Vc= 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:BLUPR0701MB1602;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB1602; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1602;4:FsHNshkmksc+4iiqV5P+7i1JfZdy+o0Z6/z/TX9ZigNeDObamz8ssWwdumXexXKBKkuCcTOfrvFXklxdymG9yeiBjgDVy8aldDd106VRRhlzfFOSZY4B6k/6uq1wW97h7VOl2ghWXL6jDnjEBU5dSWxhXp4Dso2/DrkmhFl51Qm29hjQ/zug2Bj52+rMW0qh3aV8/xwStOfFOC9BVNWMHvGoNNFKTlJdXO1YCts/n5DVeZDFWe/tKxpSlH4PRBjZh8/YUltBLtdU9aqcYN9B+HNp1958WHsOLcH4qVhWx/Ul4R6HmuMjtlZCl+nSJvXFeckN9QGW3B2jx88bfmMGYuwQXflVkVv7LaFbnmPaR3IrdJhKisxepLujSGHnwC/G X-Forefront-PRVS: 086831DFB4 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(377454003)(479174004)(24454002)(164054003)(19580395003)(19580405001)(83506001)(5001960100003)(3846002)(33656002)(189998001)(6116002)(110136002)(97756001)(86362001)(23726003)(4001350100001)(46406003)(2906002)(50466002)(586003)(66066001)(5004730100002)(1076002)(2950100001)(92566002)(40100003)(93886004)(42186005)(4326007)(77096005)(5008740100001)(54356999)(76176999)(47776003)(50986999)(81156008)(1096002)(122386002);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR0701MB1602;H:rric.localdomain;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR0701MB1602;23:LHFBu80p+W381JX8FN1SknDfymazV2ZDMPqL9Zh?= =?us-ascii?Q?y+8GLtUWRBPV3QjBA5+JuilY8BRJfykgviyp2HbZVrQ54b9sSESM5jMJlmo7?= =?us-ascii?Q?HE6kKQfJsM0p8KreZRWus9RkmcE5gbaqAFBRYU8N60PpsL85EUzc7OBbgzP6?= =?us-ascii?Q?0O41HJJRaFhsAnmhNp3MPIMxg3BUXCRTwJF0zviDWC5ZaHj3H1SNIXsp7El+?= =?us-ascii?Q?yBI9MOL4HL/POGTkG4mhMfSVeXGcyee4pMkeiJW7rAw05KVfDMl37uavYp5O?= =?us-ascii?Q?YhTA6MA7+48UAedxtnoFggz4/TIESxqe/b/rRLyJAvhOhanvSrqehTC/44Iu?= =?us-ascii?Q?JL7xGNey3OtGhaSC9cl9zXFeG9LrX8rQ3tvbQCGb0YVK6VPMueyYbgvYkfpG?= =?us-ascii?Q?2/GAAxAVrCYmj1arFLhoCWOuRRmrauRE2aXOfLNphU6sytTKSl08TeyWJUVh?= =?us-ascii?Q?BzJCvYITCKry6Y6l58WJS7202qmwkz1NFCimEoItvP/4WDUisUAAW0MnVUsJ?= =?us-ascii?Q?4+dZ8KMkebAUsMNFJi1jT4UZeWGS3fDu02krciAUTc5qIRp23rHc3tiW86CA?= =?us-ascii?Q?BAn9yspO8skpYXmDl9tU/dJkfqq/BM6Oq8FLfMsAAyKlQchLvbTM6q3u1KF4?= =?us-ascii?Q?/ekko789QJwPrOCG+0GgkuBhtGGfgmkqJD6+N/SAtqrGp/XCMheq2rBuod5a?= =?us-ascii?Q?wg9WNanPtwsP5w5JMmFDZfh3AV9V8EMEu0gaBg3826cU56/P+dtoykfMrzOn?= =?us-ascii?Q?fLyHtg9keae6MGLJZd1aB0kLonh0KmL7+34CNulv0BByg7gwxWB86hdZEUGO?= =?us-ascii?Q?aVsYaecScWwXijXxx4wFKfIKVr7NeV2e/0Xtabcwr+ahLrazcc3yWIz8Al08?= =?us-ascii?Q?C9Gn4TqwNDyoJ8TRzdNYBPck5aZ6jFGa7vC/XBtbHEzhGrHBiIHj48J4oc8X?= =?us-ascii?Q?w0dHah+JhjUZ8l1YfpfUkpxJwms3gOfd74cE6WoU2+XzzS+XTYYRqaltILkn?= =?us-ascii?Q?ZzMKuNf4s9ouZkOTbZssmSkrjTIDnGe7qqxd9xxqnTRmdY1iR745OsmKBnJR?= =?us-ascii?Q?/ZOAc8D37BCikZ9ab9mWJM3PL6NExbXpa0oRSA3VanEsxfEXuSg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1602;5:ueNd7ADmFYozepNZobv9wrQvTgFNOGjwQZ5BPMbd18JmOVJOmRGLnsJ4SzSv3pXseJb5AZmX0zqiTo2boF+ZQgpspDORIZRZA8B7BFhTBJMCvpha7udp3+3rlusWGrxOv2ZTJhnuC3p4le9jHFAlBw==;24:o7pE+Qr4btQxDB59mSklktyTVy9RrcmJUnNx5sEbFy+5W6l6CRxlMPyM5NtebOW34wR6yWKhj9rBYtbTwMNM4IpAnXynh7SeKid0E/Vijsw= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2016 12:21:24.8328 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1602 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1171 Lines: 42 On 29.02.16 15:42:58, David Daney wrote: > On 02/29/2016 09:34 AM, Robert Richter wrote: > >On 22.02.16 17:58:22, David Daney wrote: > >>From: Ganapatrao Kulkarni > >>+static int __init numa_init(int (*init_func)(void)) > >>+{ > >>+ int ret; > >>+ > >>+ nodes_clear(numa_nodes_parsed); > >>+ nodes_clear(node_possible_map); > >>+ nodes_clear(node_online_map); > >>+ numa_free_distance(); > > ^^^^^^^^^^^^^ > Cleanup for any previous numa_alloc_distance() > > >>+ > >>+ ret = numa_alloc_distance(); > >>+ if (ret < 0) > >>+ return ret; > > > >If you move this before the remaining initializers, you will need to > >clean this up on error. > > Yes, we do this. See above. > > >So better move it back after > >numa_register_nodes() as it was in v10. This should work since > >distances are used not earlier than numa is enabled. > > I moved it here for a reason. > > The init_func (of_numa_init() in this case) makes callbacks that use the > numa_distance object. We need to allocate it before using it. Allocating it > after calling the init_func() is too late. Sounds reasonable and looks sane now. Thanks, -Robert