From patchwork Mon Jan 27 17:16:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bruno Faccini X-Patchwork-Id: 860290 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2086.outbound.protection.outlook.com [40.107.244.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F0741F95A; Mon, 27 Jan 2025 17:16:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.86 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737998210; cv=fail; b=IPswvUv85L6AsL2UIzx5w0N9tySLp8ZFBBc86ejijkGrzoBEZPS0XymjMjVEo4g8qXauO/mSkSSp0wNVJMDWSDI9GZ4atF5I+fwzgkFRPQDAF1/T4Ru7LsHuJSoFGyVKkvM180Jvxwdxw8FH6AteM3KMOc2/CeipkG+pkrNUSDM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737998210; c=relaxed/simple; bh=mNtNhkE8sT3q+GSqxlJwSi55UmLwHn9HJyv8wIk1MjA=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=Jm3Ws/82u9kvMe1/icj659KGDtX1tSjr/EPbxlNVRrYSfaR1TLR9k8cKdJrfy78lPBJbOJ6j5vPqpKhgv+L2vDcCxgHRVW/Jgo6AZfNuL6e4afwbpLh3/kYkKD7UR1+9kn6eUSHrffuhjhW2IZM/k4N+SpQErVPZqKqf3fqdLtI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=BmEs5bq9; arc=fail smtp.client-ip=40.107.244.86 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="BmEs5bq9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZD46f9Le3kKlyCtV3FIAFMyFEn/tSMf2ekjdmTtRO5ZuZYL0zBK/vgFR/p4InuOV1V5K9K4EoHgKlC4aHtAe1t3JuJjPlpfTwioFGjKUqiG8SyUuX5q43gvv+q8NKdwWzP21TpCY06RIWGdP5C+Rz5ywIHyEpsF7t0MzrsI2D7IpBsqFm6CwAqsGyIxlU0f+prHIgbXv1q/i1bkfvr8E4h/YHgkQj5lGNYRawGSz3WRwE8rhCBUEk0SRmF81R38GOnB7wJns5qTG7XxuQgpTTS3NMuVJ54py5bHORZ4rKuLt21Al8Fri/VlQV7Ir8FI93Pczas5/B6o0F62/qCMwLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QjB1CkZu4BTwUA4CspDMcI/BGEVy+mM0uNwtz6WPEJA=; b=Mo/mUN8mZ8YTBNAf/+8pw7J/sU2THw9ECg9SvxGv4Uwl0qBd+BUIhhj83pd4PGn9QNrGKermAV+EurbdHwJMpvQ3eKCO0hHOZzuO6OPcAYwoRAQRyVzbr9amyjVHoZLx8KVRt+CIy04/CxPfAQlnQaXCVDQIibqtIBAz0j2QH/BGEWiCH58ilttWxhGIOIh4wYkGTP70foaJocMbCVrVPwESpyVHmUsiodtkNtoF9UqCwV5zSprbFTt2Pd/maKQtGF8RicXtLd6yQgIcdRopYjzHVkY+W6qRWm9I0dLCzAe7zx6nfcIvRnkpDN1n9QnjX1z3I/c7XMoN29/8JgkoyA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QjB1CkZu4BTwUA4CspDMcI/BGEVy+mM0uNwtz6WPEJA=; b=BmEs5bq9Mon7WNT15dbfn3y/E+1pk+SWES+JXMXQCn7TfPixg2NquNft16mzJ8Kb+9kjM1OQdurciUG48cNJiJFjbs8fajAaZn6kQ2oX69u1svV6WcT8i5+wj4EGvIA/9y5QESPo5QEEYUwUJYjkzuL8V63jXHr4C8qrbNGktVpy1M7qMdL1xp1GT9EXAU0zPyBgdKT5sKnBJofMeOrwKd6BqI7b7v5+vUGaSLodtYwTw/WrS1HGVW6tjCVJQuQai0Y9ZA0vFpCCvzGirKwAPUxB0BNbsMv0HxLe69bPO8pxG900y+9RCYTVq3OA3dVntkN70bDpbWPigPxmbuOWDQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from MW4PR12MB7261.namprd12.prod.outlook.com (2603:10b6:303:229::22) by CY8PR12MB7491.namprd12.prod.outlook.com (2603:10b6:930:92::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.22; Mon, 27 Jan 2025 17:16:45 +0000 Received: from MW4PR12MB7261.namprd12.prod.outlook.com ([fe80::d231:4655:2e3d:af1b]) by MW4PR12MB7261.namprd12.prod.outlook.com ([fe80::d231:4655:2e3d:af1b%5]) with mapi id 15.20.8377.021; Mon, 27 Jan 2025 17:16:45 +0000 From: Bruno Faccini To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, rppt@kernel.org, david@redhat.com, ziy@nvidia.com, jhubbard@nvidia.com, mrusiniak@nvidia.com, rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, hyeonggon.yoo@sk.com, Bruno Faccini Subject: [PATCH] mm/fake-numa: handle cases with no SRAT info Date: Mon, 27 Jan 2025 09:16:23 -0800 Message-ID: <20250127171623.1523171-1-bfaccini@nvidia.com> X-Mailer: git-send-email 2.43.0 X-ClientProxiedBy: SJ0PR03CA0104.namprd03.prod.outlook.com (2603:10b6:a03:333::19) To MW4PR12MB7261.namprd12.prod.outlook.com (2603:10b6:303:229::22) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW4PR12MB7261:EE_|CY8PR12MB7491:EE_ X-MS-Office365-Filtering-Correlation-Id: 49c2a7c7-b2d7-48b9-ba92-08dd3ef66062 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?q?MeoNd7hJNmYwNEU/amznpcKqHnsdWCs?= =?utf-8?q?vG3ujiDUePeVhfp7IyTqQ/b1xe8Qe+GmS69Jp9hxtsuDtJBTdAYeOQCNnjiVMVHkk?= =?utf-8?q?l9wknGHDxpSdS9yvrrf1bqYYkwQ+gcs080TnzRVw7cutB+9RXLABVVXHKBTN5fGOu?= =?utf-8?q?vTUCv0FQj4NbdiZY+T8P3Ufzh2KNn5FcLizbWep4vI11FwPz2ZNQwlgcSVW7+Ig/Y?= =?utf-8?q?/Zkbpg97vfR8wzXywm2w/pxW81fJzmXojxmqVcaGarTeHZz5KxMQXjuurGafo/cHj?= =?utf-8?q?4CYNCvy+YZd/752NUFu4wusBbjBeHJtkkhnBoAO/Xo47VJLrWIYMezYkPdoXanGBq?= =?ut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S+VzdGqsx4pdSifV1e+1Q3uWHTrNbPRNlqXqHUvOd7qv4X47fmHZYs53?= =?utf-8?q?zmTT5Q42LQyNIdtsil0W4sJ87Z/EoQXsNnjn0Hqh/DT/xWCJi15MA6xmjW2ygWjdf?= =?utf-8?q?TvHV1Q4+dN2z?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW4PR12MB7261.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?lvSa4MhD6URW8rkT/9K96ovx/j7R?= =?utf-8?q?0iVQ1zhVHFm7voPbPh2hV7oENceYbsxtUAh4AG4aMC47vfjS32l8+3jMxLi800sJe?= =?utf-8?q?mtHvssqNxqwKs5dPR3Bcb7mnLfk/Z8key/F3av4L0+K0WoA/gKU4aWfNN9H7UgomF?= =?utf-8?q?tkO0UnUnnFE10D/MCqKJSsITmqZg8rLa8Jacl1vQHBNfEoFym3kgj5RtX1Pe3K1fL?= =?utf-8?q?9XlVBs/Mn0BjRxQREQKsCFMYUl1ruI8QhUbQ9DaYrplsD5S6fYKSFNcD76KgrvjkC?= =?utf-8?q?T/2CNfUC5wG+hkVNxyGTWyFLOArf4LvtpBc642ObTk3FTKEkyKs0b4Qqdaavzlvw9?= =?utf-8?q?d6xAWeEat5HrD1LaFz4UU66q/4G17tP/WQ2PhIRuYaaKRE1PXKe242OtI5XBcPEjD?= =?utf-8?q?/EZO6tpob3usN2qdqAP0D3655HNHQ2nJEL7+R5XgXAf6xPQX5TwzKiJsW3MeX64k/?= =?utf-8?q?wmyoycUcs7u8/TBbQeNNTYatBBursLwPmTJu8L5nFe69PfOPkBqCGwb5C4F1kOxAr?= =?utf-8?q?o7nASk5uNxp4ppwtrXvePWmpluqQjNLGiP5usbbGfhmLW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HuAbDBGKzvCUKxSMr8oNZg9C3RVq/?= =?utf-8?q?JxWV6ybENuFfy3Hy/JmhFi6krQivLxcwIFinYaTpCe/O+MgWYJAhinAZYWu6c5PI6?= =?utf-8?q?9t/n/CXEPh/5?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49c2a7c7-b2d7-48b9-ba92-08dd3ef66062 X-MS-Exchange-CrossTenant-AuthSource: MW4PR12MB7261.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2025 17:16:45.8191 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MITtBMCWtWZaiM8g3uvPu2zNNcdEzfHr1TeEQtifOScvXLLVPEqOWKTgPGvgh3pKCgQ6CdXgsw84VWLrLcxQQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7491 handle more gracefully cases where no SRAT information is available, like in VMs with no Numa support, and allow fake-numa configuration to complete successfully in these cases Fixes: 63db8170bf34 (“mm/fake-numa: allow later numa node hotplug”) Signed-off-by: Bruno Faccini --- drivers/acpi/numa/srat.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index 59fffe34c9d0..00ac0d7bb8c9 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -95,9 +95,13 @@ int __init fix_pxm_node_maps(int max_nid) int i, j, index = -1, count = 0; nodemask_t nodes_to_enable; - if (numa_off || srat_disabled()) + if (numa_off) return -1; + /* no or incomplete node/PXM mapping set, nothing to do */ + if (srat_disabled()) + return 0; + /* find fake nodes PXM mapping */ for (i = 0; i < MAX_NUMNODES; i++) { if (node_to_pxm_map[i] != PXM_INVAL) { @@ -117,6 +121,11 @@ int __init fix_pxm_node_maps(int max_nid) } } } + if (index == -1) { + pr_debug("No node/PXM mapping has been set\n"); + /* nothing more to be done */ + return 0; + } if (WARN(index != max_nid, "%d max nid when expected %d\n", index, max_nid)) return -1;