Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752622AbcD0BOx (ORCPT ); Tue, 26 Apr 2016 21:14:53 -0400 Received: from mail-bl2on0068.outbound.protection.outlook.com ([65.55.169.68]:2240 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752159AbcD0BOt (ORCPT ); Tue, 26 Apr 2016 21:14:49 -0400 Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=caviumnetworks.com; Message-ID: <5720127E.1030307@caviumnetworks.com> Date: Tue, 26 Apr 2016 18:14:38 -0700 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: Dennis Chen CC: David Daney , Will Deacon , , Mark Rutland , Catalin Marinas , Tony Luck , Fenghua Yu , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , , "Rafael J. Wysocki" , Len Brown , Rob Herring , Frank Rowand , Grant Likely , Robert Moore , Lv Zheng , Hanjun Guo , Marc Zyngier , , , , , Robert Richter , Ganapatrao Kulkarni , David Daney Subject: Re: [PATCH v5 12/14] arm64, acpi, numa: NUMA support based on SRAT and SLIT References: <1461116439-22991-1-git-send-email-ddaney.cavm@gmail.com> <1461116439-22991-13-git-send-email-ddaney.cavm@gmail.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: SN1PR0701CA0077.namprd07.prod.outlook.com (10.163.126.45) To DM3PR07MB2139.namprd07.prod.outlook.com (10.164.4.145) X-MS-Office365-Filtering-Correlation-Id: cdf8f30f-6691-473b-915a-08d36e3951f5 X-Microsoft-Exchange-Diagnostics: 1;DM3PR07MB2139;2:ZRLAB1c1+FZF13XoyOEThNkeQkzH14LrtByv+X77mcwSC/9TruRgjOuDd9+LnNpppJMx3TJ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ORr2ZX95OfCVPWsWGuF1yZAP/5fTOjioTeqxi0DmSOYYQfk+CEpAH5gIb0PO8/k4yzSEMBE7efr4HXkVF/B6PVaAI4jQ5K64uHztoro3qx+yne3/o8PKGXLhT541bXDBH8e97nLUxXurCRKutpiezvng2NF+JBUqTAC4GyFU5OC+bHTwy0zkR3bdOn8KLu8giVOl1CBkm4+0dPWLd3n2qVxft3vNBHxFUaPYO/wTPe5hF/nErVUXJrOO2tHSjU8haynYWqNUCEl5D/uISutYm0sgFxyhBzwBM7q8+JYqaRJPBYHC/81Sc1AA/XNaIH+38e638Q9D86A2bsljzVj8RF8FPV0Wqfovnnwqlvjl1s6IRtxa+O8/hz5FBRK4MDOXJBy+BaD1gIQ79sVxi6FF154e849WCNrfkaSkYd67qK4VlZNcrWxJAjr1dE8NNwmx560nkB0fhfuYGpdmk74cEjdo+TzQ1Oai8UvxEzc3p8VNHnU3wEvxrYDHgOzAlhY8FPxXuiS95MjERcaSRzj8gK/mg2PUri/0QMMp9jSp6U+2UaIDron/0lZ8mf0+Nwqg4isBQQVnb9XLnT15s= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(9101521072)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);SRVR:DM3PR07MB2139;BCL:0;PCL:0;RULEID:;SRVR:DM3PR07MB2139; X-Microsoft-Exchange-Diagnostics: 1;DM3PR07MB2139;4:fHzNISHLCng5QTXgvqT+dh5WpspKEsb7ZnSxHuVJYNOzxzqMCHs9IQcIntS/FjtdBKWL7SciEfOV/MvHiD6+csUjvdD6mUL9If9Hl85Y10eH36ttMWV05AHauhb4HQ1dgiAzV+x7/YNa6QzrdhNho6sbmv3f3kWaYb2BalBmAV3YXhfMuVODqj19DO3laiEjoUaWN8AF4sU+BorO1w63zhELacGEFLcOjPhIbknbiJIC/iS8EzOGk0s4jTLF32rCSWchi+TMdzR8zynVWxPiMNYWPQhUpPI9X1whnVq8EmmDKG3SEzYPrywrsKEVlmmFFEe73JKhPwuU2QEmlEYYcxpK2UybhD8/aUnTrtrQAuLEySTu+CGUzakVFjr1/l8j0jsB04/VObDdiiT+Lxo4FQ== X-Forefront-PRVS: 0925081676 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(377454003)(24454002)(42186005)(65956001)(65816999)(65806001)(92566002)(54356999)(2906002)(50466002)(23676002)(76176999)(87266999)(36756003)(189998001)(5008740100001)(5004730100002)(64126003)(107886002)(110136002)(53416004)(33656002)(47776003)(4001350100001)(586003)(2950100001)(1096002)(6116002)(3846002)(66066001)(4326007)(19580395003)(19580405001)(230700001)(83506001)(81166005)(50986999)(4001430100002)(77096005);DIR:OUT;SFP:1101;SCL:1;SRVR:DM3PR07MB2139;H:dl.caveonetworks.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTNQUjA3TUIyMTM5OzIzOlhtckJXL0tzUW10cTlWTWRpbVhnT2tBTTA1?= =?utf-8?B?MHd3a2oxWHRGaU44WmdJQzgxSURwSkVGM3VNZElHMno4ODNBWSt6Mm4zYk03?= =?utf-8?B?dHZSSjZEWVRvZXBEYmg5bXc0dDBtMG4wNFo0K1dvOVZsb0h1UVJmM1VjYUgx?= =?utf-8?B?allEZmVmQW1RcWtrSW14YXFWcUJEelE5c0xkYjlZdFJwWGc0QWxkUlFLSEpI?= =?utf-8?B?YUJWTXQ5RnY5bzFIZjhGSk1LWWw5Q3JJbWRadXZHc0lObDBpYmV5RFRMZ2Mr?= =?utf-8?B?SXB6NkxlcktCMDJmK2wzRmpmODJCcGdRaXZxbTVDUmcyLzk3eUwyMElnc2hy?= =?utf-8?B?bnM4YzRMTjVPNUs4bEkyVUs5WFlSZEp4cHVoWHF2RlNFcG0ySysxVC9YenQx?= =?utf-8?B?SllwTmptS1RwaFUrQk80TDFxYlBERkNiUHFXV0dRT2ttVTBDdTNVMDNaYlNP?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ZLbm4ySVdzVzRuOG9EMk1Z?= =?utf-8?B?ODhaYVlBMlg4bklXKzJJMk55ZE83Z2FQK1ZscnJLcWkwYUV4SzhUSENtZ0hJ?= =?utf-8?Q?bRpiWgZe59SbcfrrFz9iDj0gfaL?= X-Microsoft-Exchange-Diagnostics: 1;DM3PR07MB2139;5:U4RStUYsppIAMR5ttSICNUaOMHm/1nEWYf9JSfI7ZJamQOZiRLXK5hvGYlyItxgEUdWJ839BwySvdUyOe3haVjLxMWgw8YRKrPZyhVJR8nZ4sEr8Fpt2fYyDvgHwpTc63zCtnVj7umuhvGjkqH7sATHC4/80I7qJ/os3dMDbNa1HODNgLrmxzGqWJ4N5BxQK;24:09vyLVWLliqhIJkIM3GvS4oWSNDQpPIt6GyupFGJQQSuRkB8NZo44+7qnnjvo1rTp7xnJYTxpn82d032XEnCWDZnI+njD3zxvSzjxm1mz0A=;7:1y/jDsJyZ+t+8t7pwpNPhzXrVj9dssstp2iHrfYh0s9Ykj4toe2oOfsH8z43kBEEnmLAgwK8rsf5xLAuw9VUf6UeRezwLqdaGUP2Fyp58Ek43+VXOs92ztzH2iwXyQuvmAKBJsN+JSAoJYqHZwgc5eyvDF0Ho2tUz2+qX3iZF+rs8jaqohP2ne/1HHawmZMCUJDwhg4WgH1oXdfT5PXOhSPohHd//r4MsM8ecpGb8As= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2016 01:14:43.2860 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR07MB2139 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6716 Lines: 140 On 04/21/2016 03:06 AM, Dennis Chen wrote: > On 20 April 2016 at 09:40, David Daney wrote: [...] >> +/* Callback for Proximity Domain -> ACPI processor UID mapping */ >> +void __init acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa) >> +{ >> + int pxm, node; >> + u64 mpidr; >> + >> + if (srat_disabled()) >> + return; >> + >> + if (pa->header.length < sizeof(struct acpi_srat_gicc_affinity)) { >> + pr_err("SRAT: Invalid SRAT header length: %d\n", >> + pa->header.length); >> + bad_srat(); >> + return; >> + } >> + >> + if (!(pa->flags & ACPI_SRAT_GICC_ENABLED)) >> + return; >> + >> + if (cpus_in_srat >= NR_CPUS) { >> + pr_warn_once("SRAT: cpu_to_node_map[%d] is too small, may not be able to use all cpus\n", >> + NR_CPUS); >> + return; >> + } >> + >> + pxm = pa->proximity_domain; >> + node = acpi_map_pxm_to_node(pxm); >> + >> + if (node == NUMA_NO_NODE || node >= MAX_NUMNODES) { >> + pr_err("SRAT: Too many proximity domains %d\n", pxm); >> + bad_srat(); >> + return; >> + } >> + >> + if (get_mpidr_in_madt(pa->acpi_processor_uid, &mpidr)) { >> + pr_err("SRAT: PXM %d with ACPI ID %d has no valid MPIDR in MADT\n", >> + pxm, pa->acpi_processor_uid); >> + bad_srat(); >> + return; >> + } >> + >> + early_node_cpu_hwid[cpus_in_srat].node_id = node; >> + early_node_cpu_hwid[cpus_in_srat].cpu_hwid = mpidr; >> + node_set(node, numa_nodes_parsed); >> + cpus_in_srat++; >> + pr_info("SRAT: PXM %d -> MPIDR 0x%Lx -> Node %d cpu %d\n", >> + pxm, mpidr, node, cpus_in_srat); >> +} > > What does the *cpu* means in above pr_info function? If it's the > logical processor ID or ACPI processor UID, then I suggest to use > pa->acpi_processor_uid instead of cpus_in_srat, I understand the > cpus_in_srat is just a count number of the entries of GICC Affinity > Struct instance in SRAT, correct me if I am wrong. So at least it sees > to me, the above pr_info will output message looks like: > SRAT: PXM 0 -> MPIDR 0x100 -> Node 0 cpu 1 > SRAT: PXM 0 -> MPIDR 0x101 -> Node 0 cpu 2 > SRAT: PXM 0 -> MPIDR 0x102 -> Node 0 cpu 3 > Yes, that is correct, and for my system seems to be what we want as the names in /sys/devices/system/cpu/ and /proc/cpu_info agree with the sequential numbering (0..95) with 48 CPUs on each node. If I make the change you suggest, I get : . . . [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x0 -> Node 0 cpu 0 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x1 -> Node 0 cpu 1 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x2 -> Node 0 cpu 2 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x3 -> Node 0 cpu 3 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x4 -> Node 0 cpu 4 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x5 -> Node 0 cpu 5 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x6 -> Node 0 cpu 6 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x7 -> Node 0 cpu 7 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x8 -> Node 0 cpu 8 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x9 -> Node 0 cpu 9 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0xa -> Node 0 cpu 10 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0xb -> Node 0 cpu 11 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0xc -> Node 0 cpu 12 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0xd -> Node 0 cpu 13 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0xe -> Node 0 cpu 14 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0xf -> Node 0 cpu 15 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x100 -> Node 0 cpu 256 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x101 -> Node 0 cpu 257 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x102 -> Node 0 cpu 258 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x103 -> Node 0 cpu 259 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x104 -> Node 0 cpu 260 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x105 -> Node 0 cpu 261 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x106 -> Node 0 cpu 262 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x107 -> Node 0 cpu 263 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x108 -> Node 0 cpu 264 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x109 -> Node 0 cpu 265 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x10a -> Node 0 cpu 266 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x10b -> Node 0 cpu 267 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x10c -> Node 0 cpu 268 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x10d -> Node 0 cpu 269 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x10e -> Node 0 cpu 270 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x10f -> Node 0 cpu 271 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x200 -> Node 0 cpu 512 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x201 -> Node 0 cpu 513 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x202 -> Node 0 cpu 514 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x203 -> Node 0 cpu 515 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x204 -> Node 0 cpu 516 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x205 -> Node 0 cpu 517 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x206 -> Node 0 cpu 518 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x207 -> Node 0 cpu 519 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x208 -> Node 0 cpu 520 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x209 -> Node 0 cpu 521 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x20a -> Node 0 cpu 522 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x20b -> Node 0 cpu 523 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x20c -> Node 0 cpu 524 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x20d -> Node 0 cpu 525 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x20e -> Node 0 cpu 526 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x20f -> Node 0 cpu 527 [ 0.000000] ACPI: NUMA: SRAT: PXM 1 -> MPIDR 0x10000 -> Node 1 cpu 65536 [ 0.000000] ACPI: NUMA: SRAT: PXM 1 -> MPIDR 0x10001 -> Node 1 cpu 65537 [ 0.000000] ACPI: NUMA: SRAT: PXM 1 -> MPIDR 0x10002 -> Node 1 cpu 65538 [ 0.000000] ACPI: NUMA: SRAT: PXM 1 -> MPIDR 0x10003 -> Node 1 cpu 65539 . . . Not really what I would want. > While the /sys/devices/system/cpu will use the ACPI processor UID to > generate the index of the cpu, like: > cpu0 cpu1 cpu2 ... > > As the GICC Affinity Struct indicated, the ps->proximity_domain is the > domain to which the logical processor belongs... > > Thanks, > Dennis >