From patchwork Sat Mar 28 18:31:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hoan Tran X-Patchwork-Id: 11463733 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1FD78913 for ; Sat, 28 Mar 2020 18:31:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D0F3D2073E for ; Sat, 28 Mar 2020 18:31:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="pvhr/4Mp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D0F3D2073E Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 062F68E0001; Sat, 28 Mar 2020 14:31:35 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 011E86B0032; Sat, 28 Mar 2020 14:31:34 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E43408E0001; Sat, 28 Mar 2020 14:31:34 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0149.hostedemail.com [216.40.44.149]) by kanga.kvack.org (Postfix) with ESMTP id CD4236B0010 for ; Sat, 28 Mar 2020 14:31:34 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 053A12C1F for ; Sat, 28 Mar 2020 18:31:34 +0000 (UTC) X-FDA: 76645614108.22.seat81_2aad96c7b2607 X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,hoan@os.amperecomputing.com,,RULES_HIT:30003:30054:30080,0,RBL:40.107.220.118:@os.amperecomputing.com:.lbl8.mailshell.net-62.14.0.32 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:amperecomputing.com-dnsbl7.mailshell.net-127.0.0.144,Custom_rules:0:1:0,LFtime:49,LUA_SUMMARY:none X-HE-Tag: seat81_2aad96c7b2607 X-Filterd-Recvd-Size: 8511 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2118.outbound.protection.outlook.com [40.107.220.118]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Sat, 28 Mar 2020 18:31:33 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AAzrEvTa/5E8UhCOuQ+KY43OdxvjKepzSCS0RP1aEPWwqkVESOqoRy69xmIhvN39qVvH/t90151cgvocrbDXI1hpwAmTnbWpScPNW+pfJtylG2gUfXWvnzYa33JiNWd0+6ZvAmROLlSuwYQls7A1RwQ49vvrm+ldd8fA5GhMRRYoZMwhPvxvUzVrWiuVINIG5gEZks+5adaSGU1iVCfBRpdkKNGiD6Hr4zYtceY5EYRYhksbtHDRxD4Qw6paY4r5Ei48yd0OKlGM7mKtkb7ayJ9PeB7TmJ3LOgoA0aXuhj/IRn5Y3hipl7JJxJtb+MycCwvrL4ly6jfSpFSF0bl46w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yyIVrsAsbqfzn9pK/jT96ImQUzYBi59QrTmo7hbAPB0=; b=eI2Qu0ND5txDUmqMZ+4TuIWQMOmx5x3QV4SUV8ixPu6tQtdNIinMw+e+oxCi0K+DbrGt7Mao/RGGGmuklOJuXtyJRZCM2wSGrxpsrqRqNDy6ghWKhQL1kRoThsJBtCFGlG8e965DX2Xqcv9eylSizH/KQok/6zXkiYkMJ+MIHpQGNy86nSLseDa2dporNP401frskPoiSUJPLemZE1XQAFbdup3dmsy6XRJ5bvIRVbBRiVWD9LYz/vpFbwWb0OdMlB66lJCOBkA3yA3xf7oLz30GG9IGeY9Yxv2kHYb2BvmTfQ9tPIsxT5IenhisixraAxlAF+52kyV4Pj4Svynbtg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yyIVrsAsbqfzn9pK/jT96ImQUzYBi59QrTmo7hbAPB0=; b=pvhr/4Mp1CKgrh2J6GPaWFrlg36qCW2DFrxZpI2wyuZ/7O9kRQ0ILGmRUG4brljG17clDTTShraFmTqWM1TcKo8Bohuc6wTmSeatRLc1p4qYThKAg9oGmo6V9EhypeTZx+JpJyrJ5cEzjg0u0qCIlcltwiFL4XX3PWPrvmyCdWE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hoan@os.amperecomputing.com; Received: from BYAPR01MB5494.prod.exchangelabs.com (2603:10b6:a03:127::30) by BYAPR01MB5205.prod.exchangelabs.com (2603:10b6:a03:7f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.19; Sat, 28 Mar 2020 18:31:32 +0000 Received: from BYAPR01MB5494.prod.exchangelabs.com ([fe80::a979:b2e2:fdaf:1ccb]) by BYAPR01MB5494.prod.exchangelabs.com ([fe80::a979:b2e2:fdaf:1ccb%6]) with mapi id 15.20.2835.026; Sat, 28 Mar 2020 18:31:31 +0000 From: Hoan Tran To: Catalin Marinas , Will Deacon , Andrew Morton , Michal Hocko , Vlastimil Babka , Oscar Salvador , Pavel Tatashin , Mike Rapoport , Alexander Duyck , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "David S. Miller" , Heiko Carstens , Vasily Gorbik , Christian Borntraeger Cc: linux-mm@kvack.org (open list:MEMORY MANAGEMENT), linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org , lho@amperecomputing.com, mmorana@amperecomputing.com, Hoan Tran Subject: [PATCH v3 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA Date: Sat, 28 Mar 2020 11:31:17 -0700 Message-Id: <1585420282-25630-1-git-send-email-Hoan@os.amperecomputing.com> X-Mailer: git-send-email 1.8.3.1 X-ClientProxiedBy: CY4PR13CA0013.namprd13.prod.outlook.com (2603:10b6:903:32::23) To BYAPR01MB5494.prod.exchangelabs.com (2603:10b6:a03:127::30) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from engdev037.mustanglab.us.amcc (4.28.12.214) by CY4PR13CA0013.namprd13.prod.outlook.com (2603:10b6:903:32::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Sat, 28 Mar 2020 18:31:29 +0000 X-Mailer: git-send-email 1.8.3.1 X-Originating-IP: [4.28.12.214] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6bc8ebec-62c0-4b6c-45f6-08d7d3463c94 X-MS-TrafficTypeDiagnostic: BYAPR01MB5205:|BYAPR01MB5205: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 03569407CC X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR01MB5494.prod.exchangelabs.com;PTR:;CAT:NONE;SFTY:;SFS:(10019020)(4636009)(376002)(396003)(136003)(39840400004)(366004)(346002)(6512007)(7416002)(107886003)(16526019)(6486002)(26005)(81166006)(4326008)(8936002)(2616005)(6666004)(186003)(956004)(8676002)(81156014)(316002)(66476007)(52116002)(6506007)(66946007)(66556008)(86362001)(478600001)(5660300002)(110136005)(2906002)(921003)(1121003);DIR:OUT;SFP:1102; Received-SPF: None (protection.outlook.com: os.amperecomputing.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WYVPVK5y7NP34qUje8I23KdDawNs+tb8HJyMIjz52VTZbp9SEP0bwe9nSeSBLDK7eGGVuozVKnFcoWXdF/IfUmIep1zd5h3IayfnquqBfSmGlflemYraEg95vigKG9BFl3WkAye6VMb7greQ/TChm2ZfLEcC8liXlQUALr/aaxlXRexhC1wg3N5hWqpoVmhwW4773EJAPZlYZr5bxk4gQILCg2H8hs44rBwoW9WIpWXm8xqaz7xgl6B8o4DsOgnuBoL55OPB2WbDqktjVv+A/8/kkKFZrtTxqfF/WP4OQ1aRgtvSDSo5f2CGAGBficgZkHsaX867Z3n1+Dwe4FdSpOKabvpDXcZntLAiZ/4lx5OcnVp1gnO/RIwOSlrwDvQl9VFxEaQ6j6ABTqxnZDDp2VCJMnxJ2ZYSa6/7x5gvLSF1HJAArkIzS6js3ZIuiS5QKBSB8h15Wy5pjzf9VTQbOvjfDBiWq+23bzPcxn5+kgbv5xsS4Uoj00IgUo5Zl++G X-MS-Exchange-AntiSpam-MessageData: u2C/PpOEwNVO/uMxt6n0UGhoNYCVYu8qcrV1J3PsGlfBFHjZOPX6oZ4Dic7NmKpThfj03b7f9i2B/FqzqhWOrqr16SA+NKKhslZSYOsgX9lg6Uq26ZAvFuEro159xpdy/ZVlDNc3RU2LN++2Ty/Qvw== X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6bc8ebec-62c0-4b6c-45f6-08d7d3463c94 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2020 18:31:31.7234 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: y439rLwrGhveJWJRVvssoUuoAqjBspUJ/DjxPK64/GziAO6YaXpXpo1ueiHaa5BLzAibQMAQPpEYiF+eBkMig7o4poQbp26PfZ3JebNi+k4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR01MB5205 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: In NUMA layout which nodes have memory ranges that span across other nodes, the mm driver can detect the memory node id incorrectly. For example, with layout below Node 0 address: 0000 xxxx 0000 xxxx Node 1 address: xxxx 1111 xxxx 1111 Note: - Memory from low to high - 0/1: Node id - x: Invalid memory of a node When mm probes the memory map, without CONFIG_NODES_SPAN_OTHER_NODES config, mm only checks the memory validity but not the node id. Because of that, Node 1 also detects the memory from node 0 as below when it scans from the start address to the end address of node 1. Node 0 address: 0000 xxxx xxxx xxxx Node 1 address: xxxx 1111 1111 1111 This layout could occur on any architecture. Most of them enables this config by default with CONFIG_NUMA. This patch, by default, enables CONFIG_NODES_SPAN_OTHER_NODES or uses early_pfn_in_nid() for NUMA. v3: * Revise the patch description V2: * Revise the patch description Hoan Tran (5): mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA powerpc: Kconfig: Remove CONFIG_NODES_SPAN_OTHER_NODES x86: Kconfig: Remove CONFIG_NODES_SPAN_OTHER_NODES sparc: Kconfig: Remove CONFIG_NODES_SPAN_OTHER_NODES s390: Kconfig: Remove CONFIG_NODES_SPAN_OTHER_NODES arch/powerpc/Kconfig | 9 --------- arch/s390/Kconfig | 8 -------- arch/sparc/Kconfig | 9 --------- arch/x86/Kconfig | 9 --------- mm/page_alloc.c | 2 +- 5 files changed, 1 insertion(+), 36 deletions(-)