Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933631AbbHKBDJ (ORCPT ); Mon, 10 Aug 2015 21:03:09 -0400 Received: from mail-by2on0131.outbound.protection.outlook.com ([207.46.100.131]:31104 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932848AbbHKBDG (ORCPT ); Mon, 10 Aug 2015 21:03:06 -0400 Authentication-Results: spf=none (sender IP is 165.204.84.221) smtp.mailfrom=amd.com; infradead.org; dkim=none (message not signed) header.d=none; X-WSS-ID: 0NSW891-07-F1F-02 X-M-MSG: From: Aravind Gopalakrishnan To: , , CC: Subject: [PATCH] sched/numa: Fix NUMA_DIRECT topology identification Date: Mon, 10 Aug 2015 20:20:48 -0500 Message-ID: <1439256048-3748-1-git-send-email-Aravind.Gopalakrishnan@amd.com> X-Mailer: git-send-email 2.4.0 MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD056;1:PgLX/jLkwhmU815/BQJwrtozhhKX6R9p4xJ2A4IXu6HfUl6ZNqI1MXOav8+ivGBrerv49PKJ1YqKfnxFJJxKAUHAEIaDQ5NlDEtX8fi15HPtB96H1OhmXKJVpXARQVD/FX2Id9tFAWFZ0FBkc7nE70tZUBa5GoYX1ZJWrlYENtSDnZQLTeKf/0fWUi78FJLITBQjwBSqbZnjKRbN6vH4dCp25YDtjYuB5pSqKvG4vyNzrBJzw6x7TCDf8GWP/MnCRJ64in5LgVNu7f5cY2XERPzsDLmCV+F+tkDynqmmrrWOI/Enz2Rq9FEjSCvlZJt0X5YM4aTd39e/jVdMq/oWKQHjKxu9HiaL2T16IrF+idQzGxYVQQuChCTZsJLe4Ysu X-Forefront-Antispam-Report: CIP:165.204.84.221;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(428002)(209900001)(3050300001)(189002)(199003)(62966003)(229853001)(86362001)(36756003)(77096005)(19580405001)(15975445007)(19580395003)(106466001)(105586002)(2201001)(47776003)(5001860100001)(77156002)(87936001)(15395725005)(189998001)(92566002)(50226001)(5003940100001)(50466002)(5003600100002)(101416001)(97736004)(46102003)(68736005)(4001540100001)(5001770100001)(5001830100001)(53416004)(48376002)(64706001)(50986999)(6606295002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR02MB1149;H:atltwp01.amd.com;FPR:;SPF:None;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;CY1PR02MB1149;2:1x54JYUlFQqYOnsUssjgc1EZtIBxXG+LOQT9cXvk+X7NFfa8LVQgH2hKGIkdL9O8kc8LZo9feTrUaWwCPLvq+HdqR/4ADLJAV5t96lBoN8+0PpovgK7hh0awpQGWlzrS6J8UCybTNB9G/QPJaI3QmkZHfWk0WgpWuqHl1g0OrBs=;3:/q52g8ZIcxAA20Ltam8x13282jclEhnNb7vCaukD8tkftrRJG0950CaWp6ho0nBMbpFy2S0kU+Hl0NijWcWk/V3oFrOPkBmR/TrrumlUT5OAVauL8QP5PCPRMMwhl0V+y9XEmo/fDLYWkTr8lkDohH3niSYGuNvvVeR/8tHRcnF54BxB9TulHhQk3hXqPcLWRjHwSZ5kMyWQ1c83gCVkY9qryDlwpe+jmJhv5HDTIVxal7H44YN2dsvYW5M8gkyX;25:W04qS1jLrkIL91QNkT0LPJgsTbhbD2GjCCr6QDN1fHmBAHx4hid99/Acpq6sLTQl3RJTu6lxnl8xPHGJqMrR/is2wMkwdJvkIWwQDGxaRdinJak/lFKcklJtcSSXQmPHtfqFNy8wjp0HA2zNovqIjj3Jz4TqRSLTM3ge2txRm7Wdwf26tC/Cv1krfuN/+GD/UvFEYDvBxTG/17SHCeRPvNY3koZHCsqDs8VRBHA5OaFSq4eapJCZsfnhZoWSxZBG0wt1au8qWE5ojDnuAaJlcw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR02MB1149; X-Microsoft-Exchange-Diagnostics: 1;CY1PR02MB1149;20:3Qc+53isrf3iXd5HEOtLjggRYabGKht4wxc2ooBM2IeYn1KyHu1yzfQGXMUrcQHagxNMyNK0kP4NXU4TPRA8ShOSc3DZMn9hfqu6RmIsZrxuWEMO0Q4z/10scI71muyGqOLI5MC36cOpkjjz67gtS8d30LfoB2FM9WMJ50WmTK+BpmfxJNqDXJKk21F9G4OQhhduz1PJ/yscYtm4Aq8nkjUa3tD+rh0t6hwYMKILdnN8gPZDLNPc60xCfAaoxOfarI/cJcWU8hX9c+849Fp2pehDj4NU8K/JHP3btzXNLX1x1Iu81HAcVEyHnvg6vrQPWbRWoY12ZpzhGc2JTZ9RGzIpXvXNRxthCwucaUWNgnCz+6RYhN7xwKAZna6hAVa9cHv5YcydNVmGGhDnP7G+iPM7NueTHm9wo337fJc4rjsR1+/rWty02fGu7L8ZJQ0+t/YntWNoZ1gPAyxX/QceoJ39ZMpOQaHtrK8BclIbBWZ+vEx+HfQTv36Ed5W6xhZi;4:tRPAlK9WDdYQvDstVtJLDCWb2N78zH2oeU5gDk3nKr05VumZK7pdygLS3nfyjbeYM/TVUxW+UEzT6/cDW11NYxLhn+uUZjBVJhs0WJ/AVCWKeOp3VReknUthvljErWJq8uab+LMY+BDJWxs7/TAOoBY18Ovc8Uvev3DP6HOdD5BNkk2R5xGkmOrWorewb23qq0K3uTyDKHD49ceBM4bpSxdYAC3/k1q+3oK9VnJ4lClFTHJ66w0bYpY43by7hXNcnU4zx9FHeLF8mL0IKPYYeL4e+DDcdfmBcx3ir+EYSII= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:CY1PR02MB1149;BCL:0;PCL:0;RULEID:;SRVR:CY1PR02MB1149; X-Forefront-PRVS: 066517B35B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR02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=?us-ascii?Q?rz/1oj/+Dq8IvU8f6ly7qgM5kN/h/gNls/kEiWxFkwJYO69Ed5e2hi8bngtv?= =?us-ascii?Q?fcI+xRD2DwI2ejMK0fbmFuWYAkHGfonxSwFoPZ9If/9YRX6yd5ht2lRAJY6J?= =?us-ascii?Q?fRhc3RGdbbJf3UWXPLxpRtPIr8It8Qe/kfwZewX4rvc5Qhmv0YLts0coVnwc?= =?us-ascii?Q?a7tsQr2WRoar/3ducuWZdCldtLcMWuNG0Gx3iLABigZois5HEv5cRpvEU/k2?= =?us-ascii?Q?E8hbcN2YEw=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR02MB1149;5:T9yc0qZ8hmmSSqZWfjbuxADGq4pUJGEYJEn184VHR5qHh52LlZlAiqv+JFahyByudterYUmD0rvhtftUlnBhyCmqOSGZEKIuiH/INNV7XHTdRFPW+wEL4ENTKPsO66rPtalNMTiZC8lidghsP2ySBw==;24:E/GV3yQTvGQjZjS7TqGjs3leWXL7H+ofOAasXafh3E+y5lt/JeFdgIxAy3VxIHs+dE4kU54eJCk6Ji8RQS7laMdJyXTGpBvei2M4OZa43/I=;20:O0l6P0iCGUPdLOKFBlwsG3oRKa85+87JslMFDfFb8O7pOS9Q3zjR21RJykxpUtG2/tYgF4f2Bx2L/7onKhrnqw== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2015 01:03:03.6980 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96;Ip=[165.204.84.221];Helo=[atltwp01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR02MB1149 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1409 Lines: 47 Systems which have all nodes at a distance of at most 1 hop should be identified as 'NUMA_DIRECT'. However, the scheduler incorrectly identifies it as 'NUMA_BACKPLANE'. This is because 'n' is assigned to sched_max_numa_distance but the code (mis)interprets it to mean 'number of hops'. Rik had actually used sched_domains_numa_levels for detecting a 'NUMA_DIRECT' topology- http://marc.info/?l=linux-kernel&m=141279712429834&w=2 But that was changed when he removed the hops table in the subsequent version- http://marc.info/?l=linux-kernel&m=141353106106771&w=2 Fixing the issue here. Signed-off-by: Aravind Gopalakrishnan --- kernel/sched/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 655557d..e51739e 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6442,8 +6442,10 @@ static void init_numa_topology_type(void) n = sched_max_numa_distance; - if (n <= 1) + if (sched_domains_numa_levels <= 1) { sched_numa_topology_type = NUMA_DIRECT; + return; + } for_each_online_node(a) { for_each_online_node(b) { -- 2.4.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/