Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752533AbcCAR6o (ORCPT ); Tue, 1 Mar 2016 12:58:44 -0500 Received: from mail-bn1bon0065.outbound.protection.outlook.com ([157.56.111.65]:59277 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750997AbcCAR6l (ORCPT ); Tue, 1 Mar 2016 12:58:41 -0500 Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=caviumnetworks.com; Message-ID: <56D5D84A.2060605@caviumnetworks.com> Date: Tue, 1 Mar 2016 09:58:34 -0800 From: David Daney User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Rob Herring , Will Deacon CC: David Daney , "linux-arm-kernel@lists.infradead.org" , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , "devicetree@vger.kernel.org" , Ard Biesheuvel , Frank Rowand , Grant Likely , Catalin Marinas , Matt Fleming , "linux-efi@vger.kernel.org" , Ganapatrao Kulkarni , Robert Richter , "linux-kernel@vger.kernel.org" , David Daney Subject: Re: [PATCH v11 08/10] dt, numa: Add NUMA dt binding implementation. References: <1455930799-5371-1-git-send-email-ddaney.cavm@gmail.com> <1455930799-5371-9-git-send-email-ddaney.cavm@gmail.com> <20160223193651.GA8491@rob-hp-laptop> <56CFA9CA.6090803@caviumnetworks.com> <56D5C9FF.8020500@caviumnetworks.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [64.2.3.194] X-ClientProxiedBy: DM2PR07CA0013.namprd07.prod.outlook.com (10.141.52.141) To SN1PR07MB2144.namprd07.prod.outlook.com (25.164.47.14) X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2144;2:VLusHwYXeWl09my5pjmpAXEzp/J5Ps694Q8Sdt94KORO725FDM9Dteov6POAHAEu3b8JiFXgJyNiI1YN8t0UYnGjgadnHmpRHfrroGKNJv7L5/sYGtb1w09n0e/j39iMsNmIX6s0O2BPRpsYCfv6kg==;3:GZSlhs2RG35D+pnIGXKaBoVcIA2kXhBMb9PJrQ+UP8FTjwXo1oa9D07dR3fBDCF0cx46HestI9xLuQkJMvfRdZkzDhnLmIdn0lqCkJrDWQe9V6LAzdKWs9VXQ09OhYZg;25:qL2G+MpyHdlt0650QQOWBkkbNFBmaLGxd19EJeFAXlO4SwkLouXNPn8MPTilP7tB9koZEoefPPtZ5/9ZmO4qpLDh+F2yN/3mlu+MPXdYRw0iFDSlpAxUicDWhZsd0gcM2P5aA6+jVmIqwafJwcWA21fJWMjZvKIGaerwf5PG5/m+KBZLYxkGK5V62L+CmoX9k54zgU4Wwc69zYgTylUSAq7xISNcQ3yCoUT44E+5IE2zgnuI/N4xNum8LqnX9ajtKa0TmWFtTrPoJdHHLEBRZs7+4/c08/4T2ABer1241ao4BFO0jsBqX7nQBuYjQny6fvSP4VbEMSFGvEEy0cJ6PQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR07MB2144; X-MS-Office365-Filtering-Correlation-Id: 7e2f9279-bc51-4ff4-b1ab-08d341fb1e02 X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2144;20:lkc4Q4/mWxWVzZSYgxsFpDR68pyCeLtoP4gPdWgmt983Rb8ewPxJNIYcThneSy3E+oYBaC/0vv9K72NJUGFYfbEPrFKOWlu56LCBeBFEafc2GGlF4zIY7X11wQc+oCm1axojQbyun+2Bmxb7oKQB826Cbqcgp8WniR0Xj/MitS/f/cRxhP1mEmBqjsybeyKN4Kn+zJKL1duY34CFvllQeduuOWnZjeO2MxpgaglTki+94l+T7Ejq+6UtRk4/1EZP1/eFXMzmhNGj2gyeqB0aCt189cHq+cMJOPxf4L/Bi4+d1xvmAhAghjRykK1YNoKdHzFh+GUUgT5S5pxvqamFawBytlRWknwcT1RF+H/f/LqY8VPd7unex9DqHOrQgWraWLG+8zo0ww5E/8+i6RhJ7gWCZ4wC/8Ts8TDrbIJdt7bJbHQ5Wgb7lfl4Cdw6ehwIZtRdvvZF0WyVZCJr0fRAXJ0gFT8eFkv/1faLdKEBrfc7WYYSQKPKjUDK+5/UwpimGUHK5Mnx03U1pQJ79xev519z1rCIkM34UeUjZcs0Q8N5Nl3OPbbHzMlVemdlvbi1YKwtnFhSygyVuDaaPke6ILpvzpviry3uw+iT2slD0hs= 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:SN1PR07MB2144;BCL:0;PCL:0;RULEID:;SRVR:SN1PR07MB2144; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2144;4:sMSH/M9iRWe6WISOZFeuwtz+k6Yhdvk6hz2NZgsEIaTmWPqp/XFFo8nM7fVVusvNAs2gRIcrKR8YLbrAbuWzq2jyXIDgxv2dvf36uhJyXWaMfwSsoOpkWYprK17kaIuEYs4mHGy31/vsy0N7NiXcV/Jc1xkgJ0xovAupdeCoEVNoY+T1rln0T67HFckv1uwa2mbUNrE9fuYD7KfMuA2d5f/4KCx3FCJGz4wIw0TyvKDLQlYiBfeNDZhRq3v5fyAXwr/J2542XBds5v/p6Wbs002/n/Rv8LPXJV2c/gm6gNnyq/tlY+xw/AEigCz7R0pF5WGzm6YOYexXE9qCeg14gpZmZuLoptY3RLPnLPJgH2NInu1JG51OrjZx0m4RQopJ X-Forefront-PRVS: 086831DFB4 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(377454003)(479174004)(24454002)(586003)(93886004)(4326007)(36756003)(33656002)(77096005)(64126003)(23676002)(1096002)(5008740100001)(2950100001)(50986999)(54356999)(76176999)(65816999)(87976001)(5001960100004)(81156009)(6116002)(3846002)(87266999)(189998001)(2906002)(83506001)(122386002)(66066001)(47776003)(65806001)(65956001)(53416004)(50466002)(230700001)(92566002)(4001350100001)(19580395003)(15975445007)(19580405001)(40100003)(5001770100001)(42186005);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR07MB2144;H:dl.caveonetworks.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjFQUjA3TUIyMTQ0OzIzOlZYcTY5amp1d1JlL3NwdTFtcVNhd0VEYzRS?= =?utf-8?B?dEJlS3hXS1loZ0dlQllUcWFGTXhQQXBvbWludmFUczlXRldidDFoVmx5L1BV?= =?utf-8?B?dHAxdFo1TEx5S2tzM2s3OHpGYWZTd0VMeFZjVTdnWS9sLzlveE5kK0NMNXZY?= =?utf-8?B?S1hEN3R0TE1nbm5PUVlCaFVjUkdiTDBldFFxZnlLU0VlTkYvQVU1NFFSbXZh?= =?utf-8?B?S0RPYm1PZWFQK1BkSzJTMURtRlR3Ykh6SXZPZnB3TUpLZ20reWNXNjJtS09R?= =?utf-8?B?a1JDd3UwMnk4bEVjaVFTTjc0WDBTS3pwN0NzaURSTE8zcTZOQ1hpajQ3bU42?= =?utf-8?B?bWpNSk85dFAzY2FGOW9ldjltSVNGemV6QkRyMmVqZ0Ercm5Xd1R0amJIMko1?= =?utf-8?B?K0RUZFk3b1JlTEhQSnYyOVhkRVZ6OVRGVG9kWjdqamVlMzBJWWZzNytEbnBq?= =?utf-8?B?M3dka0pFTHEzbEJabUZSM3k1V0RQZUlLYzBiT3hoVWlNNXpZaW16K29jcEZw?= =?utf-8?B?OUNoRmpKSGZNeXZPRmlPQ0ZZMVVKOVp3L0RLSnpNYzlmZEQvN3ZPT1Q2Y1lG?= =?utf-8?B?SWNoQWZkMlJaMS9WQ1FRNG11VmFHcEp3ZjErMFdoNThPMjBNVlNOY21hZ1hv?= =?utf-8?B?WGV5enlxQ0lOKzFFRUpXc1JPUmM1MDBweUZKQkNVcDlhaDdUTGFIQzhvRGpk?= =?utf-8?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exchange-Diagnostics: 1;SN1PR07MB2144;5:LZxXtTT357MbLiRPlzkwFx+rFSd34NhvaJ5OUr/lf23nBLdD2ucA948lBJaxPEswlFUYRiHg8bpNvSYvoxgnbS39hWPAQgx+mcx0wIxhgsIGVER/G1QGEZ+ohg6zpxa+a0cI2H+BN3bWkhXjgyBNTQ==;24:5Yj3TbJdrX3J9Sf0PmUIpIaFs81E4Kdl8yJr9c37eVAantGGZAfrDWPewTqYcYd6GfeyhotDKDbvpKDRxHAwrat0YA+t9SktzYk9x48zmVk= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2016 17:58:36.9054 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2144 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3059 Lines: 93 On 03/01/2016 09:43 AM, Rob Herring wrote: > On Tue, Mar 1, 2016 at 10:57 AM, David Daney wrote: >> On 03/01/2016 08:47 AM, Rob Herring wrote: >>> >>> On Thu, Feb 25, 2016 at 7:26 PM, David Daney >>> wrote: >>>> >>>> On 02/23/2016 11:36 AM, Rob Herring wrote: >>>>> >>>>> >>>>> On Fri, Feb 19, 2016 at 05:13:17PM -0800, David Daney wrote: >>>>>> >>>>>> >>>>>> From: Ganapatrao Kulkarni >>>>>> >>>>>> ADD device tree node parsing for NUMA topology using device >>>>>> "numa-node-id" property distance-map. >>>>> >>>>> >>>>> >>>>> I still want an adequate explanation why NUMA setup cannot be done with >>>>> an unflattened tree. PowerPC manages to do that and should have a >>>>> similar init flow being memblock based, so I would expect arm64 can too. >>>> >>>> >>>> >>>> Many things could be done. Really, we want to know what *should* be >>>> done. >>>> >>>> In the context of the current arm64 memory initialization we (more or >>>> less) >>>> do: >>>> >>>> 1) early_init_fdt_scan_reserved_mem(); >>>> 2) memory_present() >>>> 3) sparse_init() >>>> 4) other things >>>> 5) unflatten_device_tree() >>>> >>>> We are already reading information out of the FDT at #1. >>>> >>>> This patch set adds a step between 1 and 2 where we read NUMA information >>>> out of the FDT. >>> >>> >>> The dependency on unflattening is that memblock is up and we can >>> allocate a chunk from it. Isn't that dependency met by step 1 >> >> >> No. > > Really, because it seems that numa_alloc_distance is essentially doing > a memblock alloc and that happens before memory_present. > >> >>> or is >>> there a dependency on sparsemem (or something else)? >> >> >> Will Deacon talked about this over here: >> >> https://lkml.org/lkml/2016/2/26/782 > > I'm not saying to move memblock setup earlier nor before the MMU is > on, so I don't see how Will's reply is relevant other than PPC doesn't > serve as an example. Maybe PPC should be ignored because I think maybe > NUMA is only used on non-FDT systems. > > In any case, no one has clearly explained what the dependencies are or > what happens if you moved the unflattening up sooner. You told me what > the current order is which doesn't equate to dependencies. For > example, step 4 may or may not be a dependency of step 5. These are > the dependencies I'm aware of: > > memblock dependent on DT memory and reserved-memory parsing > unflattening dependent on memblock_alloc() > sparsemem dependent on NUMA parsing and memblock > I understand what you are saying. Let me go back over the code looking to separate the issues of the inertia of the initial implementation, the need to cleanly support both EFI and non-EFI firmware, and your desire to unflatten the device tree much earlier than we currently do. At this point, arm64 is the only user of the of_numa.c file. So, if you think it is not general purpose enough to live in drivers/of we could discuss the possibility of moving it under arch/arm64 David.