From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EECBC02185 for ; Mon, 20 Jan 2025 08:11:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 85AFF6B0083; Mon, 20 Jan 2025 03:11:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7E1FB280001; Mon, 20 Jan 2025 03:11:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5E6D46B0089; Mon, 20 Jan 2025 03:11:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 34DFD6B0083 for ; Mon, 20 Jan 2025 03:11:56 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id BFBC58284C for ; Mon, 20 Jan 2025 08:11:55 +0000 (UTC) X-FDA: 83027111790.19.C29AF47 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2059.outbound.protection.outlook.com [40.107.244.59]) by imf12.hostedemail.com (Postfix) with ESMTP id B0B4840003 for ; Mon, 20 Jan 2025 08:11:52 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=mq+WRxLk; spf=pass (imf12.hostedemail.com: domain of bfaccini@nvidia.com designates 40.107.244.59 as permitted sender) smtp.mailfrom=bfaccini@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1737360713; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Fs3WwkdOcRJ8uP4G+gtXBAHeNEyHrKzQIdAzpo09Z+w=; b=XTxhjN+O0ELvaAmmVelJHQnfZWlhYUmAy2LAfbNhfhkpmFtuWZbQKiHbLr/FoVVtOSGW5E IaIu+ZgpWNkFtOi4up9V6XhS24UhnYhpOay76nvOX27ihSTCNwr3IsBbAbYdY8CyY0MojJ w8vAeXzw7vekyPu459FVHYDRGeliwII= ARC-Authentication-Results: i=2; imf12.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=mq+WRxLk; spf=pass (imf12.hostedemail.com: domain of bfaccini@nvidia.com designates 40.107.244.59 as permitted sender) smtp.mailfrom=bfaccini@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1737360713; a=rsa-sha256; cv=pass; b=UdG3LmU3LKjmT5m7zc9TMvMMthO6AuQ2XqwnggNNLk4Cbaxr/Qb2RlsGCnfNXWNVqmELN/ XQSpQqD6IkgZCQNIaaOnaQQg0IFyNNVGBcTieVk8dJTJ1zrp3SQjOktB66wzybEPQSPk50 OH4Bgau5AeEnzoMHLxSdTS+ckzTJjIg= ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aU+FzJDruu/wEykVYjyVOhRLwEfFcFlzDnHF+cwSSt1FKfNouFh8SV5pYflaNHX/jhrSdlHkwTRgsYXI3RyUOUxn5Gq5sEJZ63vm6bY9DE3a53ttwAOhuN1N+VfRI5YN4Zfa8bVRlJW0PZhJWNz2TI8NZVuq6RCO0IOwyTNtXc/WLfMpi2SXJSdSJ9kPodGZCGYakPcq40I49I23ggRtQjUR1u6kmlc1z58gLUqzP/LJyi/p9Z7S9Z0NPvurf1JAQQHGx09Dk7xb7ab7pJxb5ehZp/MJDNz/dJBcm3b/Mes7hbd/gNL5DUMhUt4VnZa5LQd1a8GvdexgJ/PzkzvTSw== 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=Fs3WwkdOcRJ8uP4G+gtXBAHeNEyHrKzQIdAzpo09Z+w=; b=MdOJJ0YjU+jAfPUOZzcjFMlz9GSgvFRp+UIZw/YNi4uxF7hqRqSKhdMYyF+2T5IP0jdjFpgi6jCmRg6Wzv1T1HvA10OSToYC9C39anHlyMGtksCuOYoEV+2EpaKN3qk4fyMKbQVtvObARneXWGNs3+Hkev+iI9ZbFybhEQfLbbFrVnO+ufWgSKs+3ZJcQLxbLW/8PYRnhxtUI4Dt9Y4/Fb8GBe2gbgXQyTzxrw+Ad4sXQ//0lXNy+/bpTkoyKiSezEaCCWg/1MYfw1J51QvQX1lhKnoBeT2ySbHE+zxRnpBRnwYbm9LSDpz6GhyilkiTgOjY37Ll37TAkkHcX3rWGA== 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=Fs3WwkdOcRJ8uP4G+gtXBAHeNEyHrKzQIdAzpo09Z+w=; b=mq+WRxLkavps/fcdrKpbutuet1SCeJFpFUmGh7qXvitXB5ElgungRXP+t+m2UyKBwnruokPegP/eF3n/N35Jfdo+qedhP3Jfh4Bj9PvMZazZE+27sSexVkgbByOoS9s1FG6eW876ac/xngs/kqvxYH9bD36cJntvpaYviilL7dVPRPJikYW85zvmxYs6/qiFHHMTc1woZSGxauMNdD+lyWUQ0bq3KngBL5tR4rEFgf4BYS1orgtBnukV9EXX2hSO45kg/VUZRNoAt8zovVqewwpRNdzkfdHIbc9ACgzKkidC2lqm/XPBe+5tZFrfvAoMbntiiuaNiKjPJedD31K2Bw== Received: from MW4PR12MB7261.namprd12.prod.outlook.com (2603:10b6:303:229::22) by MW4PR12MB7015.namprd12.prod.outlook.com (2603:10b6:303:218::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.22; Mon, 20 Jan 2025 08:11:48 +0000 Received: from MW4PR12MB7261.namprd12.prod.outlook.com ([fe80::d231:4655:2e3d:af1b]) by MW4PR12MB7261.namprd12.prod.outlook.com ([fe80::d231:4655:2e3d:af1b%4]) with mapi id 15.20.8356.020; Mon, 20 Jan 2025 08:11:48 +0000 Message-ID: <2828f33f-bb13-4d94-b738-b15f92da43a3@nvidia.com> Date: Mon, 20 Jan 2025 09:11:41 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [fake numa not working] [PATCH 1/1] mm/fake-numa: allow later numa node hotplug To: Zi Yan , Hyeonggon Yoo Cc: kernel_team@skhynix.com, 42.hyeyoo@gmail.com, "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "akpm@linux-foundation.org" , "rppt@kernel.org" , "david@redhat.com" , "jhubbard@nvidia.com" , "mrusiniak@nvidia.com" References: <20250106120659.359610-1-bfaccini@nvidia.com> <20250106120659.359610-2-bfaccini@nvidia.com> <1DC02706-256B-4B61-B309-7D86595F4B22@nvidia.com> <7a641617-a4e5-45cd-bb1f-628bacd44046@sk.com> Content-Language: fr From: Bruno Faccini In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SJ0PR03CA0217.namprd03.prod.outlook.com (2603:10b6:a03:39f::12) To MW4PR12MB7261.namprd12.prod.outlook.com (2603:10b6:303:229::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW4PR12MB7261:EE_|MW4PR12MB7015:EE_ X-MS-Office365-Filtering-Correlation-Id: 7893513a-45e7-46d5-3361-08dd392a1620 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?B?M1AwWXJOU0V0Y09tT2VNV0xmNmlodWxRb0JrWjk3aG5nQXl6ZVJDOFVhb1Bq?= =?utf-8?B?L2c4TVJ1MXo4a0tQRExjaTVTMmhUaFEvYWxxU0E5MUJtSkozRGRSbW9kM1Yy?= =?utf-8?B?T2VHNEhuUnBEYWJUeTd5bm94QUsrOW1IcnFlUmI1VFVPZWU4UTRXUmZwa3g1?= =?utf-8?B?dDViUndnR284c0ozcGMyTFhlbnJ2TnFtcTNtY1lNTTlnSGh1bXZlamg4enVv?= =?utf-8?B?MGpPK2ZtZnJUVmZvWkFTTEhJekFNZXUzZmlJNlVrdDNnUWlrQmJlNExsVURz?= =?utf-8?B?UTdFb1RxeGU2bG80VGJoUTZWWEF1d0NJdkNBbm11MUZBdS84MUxmVUFwREY2?= =?utf-8?B?aHhFOElRek43WWJzK0l1ZDVzR01IY01ISmdEOXFRbkhPN05adC8vVmxtQW1D?= =?utf-8?B?L3lqMWJBcTZoWXowb2twMlEwMHA5WE5IWFlaV1BiMlVyR0UySWI1UXV2aEFn?= =?utf-8?B?NWpkSGhpblZVdWhxM0VOT2tCRHV0MnRzMjVqWE55R3U3OURpMUZONWdHamds?= =?utf-8?B?WjNZN01iQUMvNDVaOVZVcVJpNENHb0pHNmNzN205bDk3YThiZHc1TnNxMGhM?= =?utf-8?B?Y1hKdHQ2Wk5VVGxnL2hNOEJUQVh5OFZkMGFHWGtPMXhkdUw0Mndjb2FRMUxB?= =?utf-8?B?VHlSNlBva1p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oSCtHa1FWLzRnTzl5aGE4NnIwRjRHaTJSbUdTK25VUFNZS1ZReUYw?= =?utf-8?B?anE0QWM0TEkzVzJSalBEOG9jMXJrb1BmRUZKaGlXd1JaZ3NVL2FGdHRya2gx?= =?utf-8?B?M2NleHZqT1RBZ0pDd25Kbk5xU3N4c1lvR3dpbThvQW1KWGFBWE4zWkZnVGxl?= =?utf-8?B?Qk0vSnZsSGNBaGpuczhhL0Fad2p4KzVTUEkvYi9yVHpoRUM5TjRjN01aRDh2?= =?utf-8?B?TTlWVkVkSS9ZQU1yZFhCS2VEWkxrMTBCNlhsVFdtMjJWYlVxcGlmNVVpek1Y?= =?utf-8?Q?EXYI+Jzp03WEn?= 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)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YlFaNlMzSHJhUSsrR3ZqaEVVeHJJNm1Za29NWWw4T0wyOTE2Z1VZUStTSE9z?= =?utf-8?B?RDZlcyt3NlBUVkdVOTZHV0hYV3BwTWJQZUpScENBUzBXSG1xOXdLL2xkVjBk?= =?utf-8?B?bE1vYlkzbzQ5RTJHNDdZVXg2b2lVWXpSZG9OUDljYkJIMW9Fa2o3QndZb3N1?= =?utf-8?B?QStobFpnUmxLVXdUN0ZIdlNoQW5veitLdUxLdnRpb0szVVlsYldMU2JKdVls?= =?utf-8?B?NXdocEUxb2piL3lSeWtKMGg3dThteUt0QzRlUHljRzNwMWZIMSs3aHI4SVQ5?= =?utf-8?B?RWNtaHU2S0c1anNCMmkyQ0JCSUR2WjkwSWNaNG5oVlVIME8rV2pvUy9uY2dY?= =?utf-8?B?bTliY2Y1ZGd4Z2tISTZ4Tm80ajRRSWxtVTJZMzN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361-08dd392a1620 X-MS-Exchange-CrossTenant-AuthSource: MW4PR12MB7261.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2025 08:11:48.1176 (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: 9EYmi26g1L6g0SI+xBlCFWw/ww4phBSoW24U8zYGs/9TsePxiQQvAFAeAw1jg52c1DBB1pKyJ5yxc7JK+X1HGw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7015 X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: B0B4840003 X-Stat-Signature: 4pj8mketng3pduh6pdbkor8rm16jpe8p X-HE-Tag: 1737360712-732151 X-HE-Meta: U2FsdGVkX18qP3Bc2V0MFiNjq8wgH1sykUtt3QaKIKM3TWlGrYubBmI4JxjyQd00NDz2vp0XQ8sNpFha2SnZKZrSzpxZtw6tZvw36YkfCSP/elVlXHGuiPwlgzxCRJXsmSQObA+dVzg8xN94VNK4EVgG3PGxxNxir/FS7X2EprAmxslNJ8q7+b+3E2TuuWQY0qXBH9uU/zdtfTdBOuTWxLxY8Z3v39JNO+S5se8mLsKNfRn0MJya4/ghfS78eKNUeo/nI1Dm+5zj/Qawf/IBzspW1pkPnK/MXOZ9iZ/lgWfwyMI+UZfRDxzRvhrErNpK4CMcIYPvtw4mLf9UKaWJw2rShzJoE9a/X3zV9LgnSoVhszDtPWbnc2Wf95+YruEeqY3fUfvraXAqXTW8FMU1oiqaMIqIA6wIqhylnL6iPInqAN1O6o1VwV9BgnJReYXL5XE7iQDBy6SxOfdERutTVij3jmnwLH8kwhCyO3UBLmlap47K1xuPHudjseIbXokgK1trAgxontfCVBWICG1auWddqZSl3KHOXhZmpTljN+OU6AKv2rKOrgg6nZa+YHhrwSMdl5NDLTa8RG63ItAS4zOc5iCmn2vIzU1FZG2hRdls71D0/dkVaA2vH2Q5ZrdTrlNj0MMHWc+35jhFCiaystoWdiEX2jpAS9RZqAT8f/GVU36fZgAwLHK+MR/ZWFTZEEFkgVpzG6xjNnrGqtbkrW8vy5ldBdpkMgSP+K/9KTUNuw+i4zYQHw8eOo4mZJ9XGl9IFjfpjXmZ+lMupPccguf4aIoos9kIWJRdo8YlyMyVElQWy1Dw56+R9IbP6UGtGn0k56VsNdrnXbtF4osF4+dLoxZTOir9GGOUsb1NQHnlNOBQKTkLHBZ4Bvk4XNVPWuV4kIKynQ/91nSpCexeZ+hI8s211ySkOs+Ts9YYpSGmHFnto5tfiBt/sRTncvnKk2/aF4lUoZ0Q2bFfCGk bKRHGd/8 7qZxSrWGUPqJTLyp5u9yYtY4Tbs1WUtbVb3zu2TKr3kkndzE9UXbGdvf5trPqy/VUh38nVJ4iJNYLd80FiiujMB4J5cGK0dq24hVlOMh6puKRf5iWUrRT/BZpcjamnwtqmVK6XATy1p8XweVEeITwoL3Ec5BJlb+rggP3mTpQw55ROFQ1/IaG+33iZFfUJob+9kOp50dg6Hxa5oF4vS7wQU0rRDajNF0N0fRY/+FMeOiSCXvqYU5UnI/tjKm+qWuu3fLWanEoC232dcIOJM3o6e9BCv++Wm0SBTrODBZaQfzyKvkFxjDYprFQ4wI0W/2lAEF+AsGthElK5aH6nqkhlF3eAPpgXTctG96wlWw4uIHdVMsGGORYP4P4CFUN4JpmFMQSHRNV7b1STMgmAkTeJ9ehpmYvHEPo+WrqsCH8UGUSNBrX7M91Cq26gRu3yCANCxn+p7u5jleYg4ChHms73yD1PnWLTDdpABGxyyk1Rz/H/XiF9op5+K3Ae9dR62X1G/x0NvRsho8ce0w= 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: List-Subscribe: List-Unsubscribe: Sorry for my late answer, I was out traveling. Le 20/01/2025 à 04:27, Zi Yan a écrit : > On Sun Jan 19, 2025 at 9:37 PM EST, Hyeonggon Yoo wrote: >> >> >> On 1/20/2025 11:16 AM, Zi Yan wrote: >>> On Sun Jan 19, 2025 at 7:37 PM EST, Hyeonggon Yoo wrote: >>>> >>>> >>>> On 1/18/2025 4:09 AM, Zi Yan wrote: >>>>> On 17 Jan 2025, at 0:00, Hyeonggon Yoo wrote: >>>>> >>>>>> On 1/6/2025 9:06 PM, Bruno Faccini wrote: >>>>>>> Current fake-numa implementation prevents new Numa >>>>>>> nodes to be later hot-plugged by drivers. >>>>>>> A common symptom of this limitation is the >>>>>>> "node was absent from the node_possible_map" >>>>>>> message by associated warning in mm/memory_hotplug.c: >>>>>>> add_memory_resource(). >>>>>>> This comes from the lack of remapping in both >>>>>>> pxm_to_node_map[] and node_to_pxm_map[] tables >>>>>>> to take fake-numa nodes into account and thus >>>>>>> triggers collisions with original and physical nodes >>>>>>> only-mapping that had been determined from BIOS tables. >>>>>>> This patch fixes this by doing the necessary node-ids >>>>>>> translation in both pxm_to_node_map[]/node_to_pxm_map[] >>>>>>> tables. >>>>>>> node_distance[] table has also been fixed accordingly. >>>>>>> >>>>>>> Signed-off-by: Bruno Faccini >>>>>> >>>>>> Hi Bruno, >>>>>> >>>>>> This commit causes WARN() and disables fakenuma >>>>>> when I pass "numa=fake=4U" on my QEMU setup. >>>>>> >>>>>> Attaching WARN() log and git bisect log to help debugging. >>>>> >>>>> Is your VM getting 4 NUMA nodes at the end? >>>> >>>> No, it only gets node 0 at the end. >>> >>> Got it. >>> Yes, it is expected that if something fails, we get back to the orig config. >>>> >>>>> Can you also share your QEMU command line and your kernel config? >>>> >>>> The config is attached (fakenuma.config) >>>> >>>> QEMU command line: >>>> $ qemu-system-x86_64 \ >>>> -cpu host \ >>>> -enable-kvm \ >>>> -smp $(nproc) \ >>>> -m 32G \ >>>> -nographic \ >>>> -kernel arch/x86/boot/bzImage \ >>>> -initrd ../../rootfs.cpio.gz \ >>>> -nic user,model=virtio-net-pci \ >>>> -append "console=ttyS0 numa=fake=4U" >>>> >>>>> This can help Bruno reproduce the issue locally. At least, I >>>>> cannot reproduce it on mm-everything-2025-01-16-23-18. >>>> >>>> Still reproduced on mm-everything-2025-01-18-04-55 with my setup. >>>> >>>>> I also >>>>> notice that my VM does not have “No NUMA configuration found” >>>>> (in your log) in its kernel log and that might explain >>>>> why I could not reproduce it. >>>> >>>> Did you do NUMA configuration (-numa in QEMU) for your VM? >>>> I didn't, but it's still expected to work 'cause it's fake numa. >>> >>> No. It seems that the "No NUMA configuration found" is caused by your >>> qemu, where dummy_numa_init() is used (maybe ACPI SRAT is not >>> populated?) >> >> FYI, Yes. ACPI SRAT is not populated. >> >> $ qemu-system-x86_64 --version >> QEMU emulator version 6.2.0 (Debian 1:6.2+dfsg-2ubuntu6.24) >> Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers > > Basically, fix_pxm_node_maps() breaks fakenuma when it cannot fix the > pxm_to_node_map() due to ACPI SRAT is missing. IMHO, it should let > fakenuma proceed with a warning. The diff below fixed the issue > locally, but Bruno can tell if I miss anything. Right, I did not anticipate that SRAT information is not provided ... > > diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c > index 59fffe34c9d0..18d04f054e93 100644 > --- a/drivers/acpi/numa/srat.c > +++ b/drivers/acpi/numa/srat.c > @@ -95,9 +95,12 @@ 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; > > + 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,9 +120,9 @@ int __init fix_pxm_node_maps(int max_nid) > } > } > } > - if (WARN(index != max_nid, "%d max nid when expected %d\n", > - index, max_nid)) > - return -1; > + /* No srat data */ > + if (index != max_nid) > + return 0; > Yes, I also believe that removing the warning and return is the way to handle missing SRAT informations case. I will push a patch update later today. Many thanks to have done the necessary work to identify/fix this guys !!! > nodes_clear(nodes_to_enable); > >> >>> I used the patch below to emulate the situation and >>> reproduced the issue. Since dummy_numa_init() is used when there is >>> no underlying NUMA architecture, NUMA initialization fails, or NUMA >>> is disabled on the command line (the last does not apply here), >>> it should be properly handled. I will let Bruno look into it. >>> >>> Thank you for the info. >>> >>> diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c >>> index 64e5cdb2460a..70dfd9bfb23f 100644 >>> --- a/arch/x86/mm/numa.c >>> +++ b/arch/x86/mm/numa.c >>> @@ -223,7 +223,7 @@ static int __init dummy_numa_init(void) >>> */ >>> void __init x86_numa_init(void) >>> { >>> - if (!numa_off) { >>> + if (0 && !numa_off) { >>> #ifdef CONFIG_ACPI_NUMA >>> if (!numa_init(x86_acpi_numa_init)) >>> return; >>> >>>>>> >>>>>> [WARN() splat] >>>>>> >>>>>> [ 0.009676] No NUMA configuration found >>>>>> [ 0.009677] Faking a node at [mem 0x0000000000000000-0x000000083fffffff] >>>>>> [ 0.009705] Fake node size 16895MB too small, increasing to 16896MB >>>>>> [ 0.009708] Faking node 0 at [mem 0x0000000000001000-0x0000000420000fff] (16896MB) >>>>>> [ 0.009711] Faking node 1 at [mem 0x0000000420001000-0x000000083fffffff] (16895MB) >>>>>> [ 0.009738] ------------[ cut here ]------------ >>>>>> [ 0.009739] -1 max nid when expected 1 >>>>>> [ 0.009760] WARNING: CPU: 0 PID: 0 at drivers/acpi/numa/srat.c:120 fix_pxm_node_maps+0x577/0x810 >>>>>> [ 0.009766] Modules linked in: >>>>>> [ 0.009769] CPU: 0 UID: 0 PID: 0 Comm: swapper Not tainted 6.13.0-rc6+ #31 >>>>>> [ 0.009771] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 >>>>>> [ 0.009772] RIP: 0010:fix_pxm_node_maps+0x577/0x810 >>>>>> [ 0.009774] Code: 8b 85 40 ff ff ff 44 8b 8d 44 ff ff ff 8b 85 48 ff ff ff e9 83 fb ff ff 44 89 f2 44 89 ce 48 c7 c7 aa 2f 84 8d e8 b9 71 01 fe <0f> 0b 41 b8 ff ff ff ff e9 ba fb ff ff 48 c7 c7 a0 d8 d1 8d 44 89 >>>>>> [ 0.009776] RSP: 0000:ffffffff8da03be0 EFLAGS: 00010046 ORIG_RAX: 0000000000000000 >>>>>> [ 0.009778] RAX: 0000000000000000 RBX: 0000000000000400 RCX: 0000000000000000 >>>>>> [ 0.009779] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 >>>>>> [ 0.009780] RBP: ffffffff8da03ca8 R08: 0000000000000000 R09: 0000000000000000 >>>>>> [ 0.009781] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000001 >>>>>> [ 0.009782] R13: 00000000000007ff R14: 0000000000000001 R15: 0000000000000000 >>>>>> [ 0.009783] FS: 0000000000000000(0000) GS:ffffffff8de8c000(0000) knlGS:0000000000000000 >>>>>> [ 0.009784] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 >>>>>> [ 0.009785] CR2: ffff90e4bde01000 CR3: 00000001bd03e000 CR4: 00000000000200b0 >>>>>> [ 0.009788] Call Trace: >>>>>> [ 0.009790] >>>>>> [ 0.009792] ? show_regs+0x71/0x90 >>>>>> [ 0.009797] ? __warn+0x8d/0x150 >>>>>> [ 0.009799] ? fix_pxm_node_maps+0x577/0x810 >>>>>> [ 0.009802] ? report_bug+0x1ab/0x1c0 >>>>>> [ 0.009805] ? fixup_exception+0x27/0x380 >>>>>> [ 0.009809] ? early_fixup_exception+0xa2/0xf0 >>>>>> [ 0.009813] ? do_early_exception+0x28/0x90 >>>>>> [ 0.009816] ? early_idt_handler_common+0x2f/0x3a >>>>>> [ 0.009819] ? fix_pxm_node_maps+0x577/0x810 >>>>>> [ 0.009822] ? numa_cleanup_meminfo+0x8c/0x5b0 >>>>>> [ 0.009828] numa_emulation+0x4e3/0xad0 >>>>>> [ 0.009830] ? __pfx_dummy_numa_init+0x10/0x10 >>>>>> [ 0.009833] ? __pfx_dummy_numa_init+0x10/0x10 >>>>>> [ 0.009836] numa_memblks_init+0x10c/0x2c0 >>>>>> [ 0.009838] ? __pfx_dummy_numa_init+0x10/0x10 >>>>>> [ 0.009840] numa_init+0x61/0x3e0 >>>>>> [ 0.009842] ? topology_register_boot_apic+0x2a/0x40 >>>>>> [ 0.009846] x86_numa_init+0x65/0x80 >>>>>> [ 0.009848] initmem_init+0xe/0x20 >>>>>> [ 0.009850] setup_arch+0x9d8/0xfa0 >>>>>> [ 0.009852] ? _printk+0x58/0x90 >>>>>> [ 0.009855] start_kernel+0x5f/0xb50 >>>>>> [ 0.009860] x86_64_start_reservations+0x18/0x30 >>>>>> [ 0.009863] x86_64_start_kernel+0xc0/0x110 >>>>>> [ 0.009864] ? setup_ghcb+0xe/0x140 >>>>>> [ 0.009867] common_startup_64+0x13e/0x141 >>>>>> [ 0.009871] >>>>>> [ 0.009871] ---[ end trace 0000000000000000 ]--- >>>>>> >>>>>> [Git bisect log] >>>>>> >>>>>> # bad: [f378252a2168c2fbf8fc08b635061e5f6748c1f2] kasan: sw_tags: use str_on_off() helper in kasan_init_sw_tags() >>>>>> git bisect bad f378252a2168c2fbf8fc08b635061e5f6748c1f2 >>>>>> # good: [cbc5dde0a461240046e8a41c43d7c3b76d5db952] fs/proc: fix softlockup in __read_vmcore (part 2) >>>>>> git bisect good cbc5dde0a461240046e8a41c43d7c3b76d5db952 >>>>>> # good: [fb73203263021f2ee9dd54d280b1c543d10acd76] mm: move common part of pagetable_*_ctor to helper >>>>>> git bisect good fb73203263021f2ee9dd54d280b1c543d10acd76 >>>>>> # bad: [8fd966c9310f14d5bbe653cf087853582170aad6] mm, swap: remove old allocation path for HDD >>>>>> git bisect bad 8fd966c9310f14d5bbe653cf087853582170aad6 >>>>>> # bad: [8646971f02651146554233d63fdd721f5f060973] mm: shmem: skip swapcache for swapin of synchronous swap device >>>>>> git bisect bad 8646971f02651146554233d63fdd721f5f060973 >>>>>> # good: [b8ba614eaa8dd31702c61e7df7231b1b18b99259] mm/damon/paddr: report filter-passed bytes back for DAMOS_STAT action >>>>>> git bisect good b8ba614eaa8dd31702c61e7df7231b1b18b99259 >>>>>> # good: [fd0935b8e9e8c2edf05a3d0ffa09d0aa3e9cf2dd] Docs/ABI/damon: document per-region DAMOS filter-passed bytes stat file >>>>>> git bisect good fd0935b8e9e8c2edf05a3d0ffa09d0aa3e9cf2dd >>>>>> # good: [3ffd3cd7e2e8793d3b5fbb83c03668c47ab6d599] selftests/damon: remove tests for DAMON debugfs interface >>>>>> git bisect good 3ffd3cd7e2e8793d3b5fbb83c03668c47ab6d599 >>>>>> # good: [bf9f93f0b7bff8af780330f5094775a39caf3612] mm/damon: remove DAMON debugfs interface >>>>>> git bisect good bf9f93f0b7bff8af780330f5094775a39caf3612 >>>>>> # bad: [1746744be6ff271e29345a5be4cc144aa33b10ab] mm/memmap: prevent double scanning of memmap by kmemleak >>>>>> git bisect bad 1746744be6ff271e29345a5be4cc144aa33b10ab >>>>>> # bad: [ca19a5ab8756ef78c34d02d2b8c266a9cc7bf57d] mm/fake-numa: allow later numa node hotplug >>>>>> git bisect bad ca19a5ab8756ef78c34d02d2b8c266a9cc7bf57d >>>>>> # first bad commit: [ca19a5ab8756ef78c34d02d2b8c266a9cc7bf57d] mm/fake-numa: allow later numa node hotplug >>>>>> >>>>>>> --- >>>>>>> drivers/acpi/numa/srat.c | 86 ++++++++++++++++++++++++++++++++++++ >>>>>>> include/acpi/acpi_numa.h | 5 +++ >>>>>>> include/linux/numa_memblks.h | 3 ++ >>>>>>> mm/numa_emulation.c | 45 ++++++++++++++++--- >>>>>>> mm/numa_memblks.c | 2 +- >>>>>>> 5 files changed, 133 insertions(+), 8 deletions(-) >>>>>>> >>>>>>> diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c >>>>>>> index bec0dcd1f9c3..59fffe34c9d0 100644 >>>>>>> --- a/drivers/acpi/numa/srat.c >>>>>>> +++ b/drivers/acpi/numa/srat.c >>>>>>> @@ -81,6 +81,92 @@ int acpi_map_pxm_to_node(int pxm) >>>>>>> } >>>>>>> EXPORT_SYMBOL(acpi_map_pxm_to_node); >>>>>>> +#ifdef CONFIG_NUMA_EMU >>>>>>> +/* >>>>>>> + * Take max_nid - 1 fake-numa nodes into account in both >>>>>>> + * pxm_to_node_map()/node_to_pxm_map[] tables. >>>>>>> + */ >>>>>>> +int __init fix_pxm_node_maps(int max_nid) >>>>>>> +{ >>>>>>> + static int pxm_to_node_map_copy[MAX_PXM_DOMAINS] __initdata >>>>>>> + = { [0 ... MAX_PXM_DOMAINS - 1] = NUMA_NO_NODE }; >>>>>>> + static int node_to_pxm_map_copy[MAX_NUMNODES] __initdata >>>>>>> + = { [0 ... MAX_NUMNODES - 1] = PXM_INVAL }; >>>>>>> + int i, j, index = -1, count = 0; >>>>>>> + nodemask_t nodes_to_enable; >>>>>>> + >>>>>>> + if (numa_off || srat_disabled()) >>>>>>> + return -1; >>>>>>> + >>>>>>> + /* find fake nodes PXM mapping */ >>>>>>> + for (i = 0; i < MAX_NUMNODES; i++) { >>>>>>> + if (node_to_pxm_map[i] != PXM_INVAL) { >>>>>>> + for (j = 0; j <= max_nid; j++) { >>>>>>> + if ((emu_nid_to_phys[j] == i) && >>>>>>> + WARN(node_to_pxm_map_copy[j] != PXM_INVAL, >>>>>>> + "Node %d is already binded to PXM %d\n", >>>>>>> + j, node_to_pxm_map_copy[j])) >>>>>>> + return -1; >>>>>>> + if (emu_nid_to_phys[j] == i) { >>>>>>> + node_to_pxm_map_copy[j] = >>>>>>> + node_to_pxm_map[i]; >>>>>>> + if (j > index) >>>>>>> + index = j; >>>>>>> + count++; >>>>>>> + } >>>>>>> + } >>>>>>> + } >>>>>>> + } >>>>>>> + if (WARN(index != max_nid, "%d max nid when expected %d\n", >>>>>>> + index, max_nid)) >>>>>>> + return -1; >>>>>>> + >>>>>>> + nodes_clear(nodes_to_enable); >>>>>>> + >>>>>>> + /* map phys nodes not used for fake nodes */ >>>>>>> + for (i = 0; i < MAX_NUMNODES; i++) { >>>>>>> + if (node_to_pxm_map[i] != PXM_INVAL) { >>>>>>> + for (j = 0; j <= max_nid; j++) >>>>>>> + if (emu_nid_to_phys[j] == i) >>>>>>> + break; >>>>>>> + /* fake nodes PXM mapping has been done */ >>>>>>> + if (j <= max_nid) >>>>>>> + continue; >>>>>>> + /* find first hole */ >>>>>>> + for (j = 0; >>>>>>> + j < MAX_NUMNODES && >>>>>>> + node_to_pxm_map_copy[j] != PXM_INVAL; >>>>>>> + j++) >>>>>>> + ; >>>>>>> + if (WARN(j == MAX_NUMNODES, >>>>>>> + "Number of nodes exceeds MAX_NUMNODES\n")) >>>>>>> + return -1; >>>>>>> + node_to_pxm_map_copy[j] = node_to_pxm_map[i]; >>>>>>> + node_set(j, nodes_to_enable); >>>>>>> + count++; >>>>>>> + } >>>>>>> + } >>>>>>> + >>>>>>> + /* creating reverse mapping in pxm_to_node_map[] */ >>>>>>> + for (i = 0; i < MAX_NUMNODES; i++) >>>>>>> + if (node_to_pxm_map_copy[i] != PXM_INVAL && >>>>>>> + pxm_to_node_map_copy[node_to_pxm_map_copy[i]] == NUMA_NO_NODE) >>>>>>> + pxm_to_node_map_copy[node_to_pxm_map_copy[i]] = i; >>>>>>> + >>>>>>> + /* overwrite with new mapping */ >>>>>>> + for (i = 0; i < MAX_NUMNODES; i++) { >>>>>>> + node_to_pxm_map[i] = node_to_pxm_map_copy[i]; >>>>>>> + pxm_to_node_map[i] = pxm_to_node_map_copy[i]; >>>>>>> + } >>>>>>> + >>>>>>> + /* enable other nodes found in PXM for hotplug */ >>>>>>> + nodes_or(numa_nodes_parsed, nodes_to_enable, numa_nodes_parsed); >>>>>>> + >>>>>>> + pr_debug("found %d total number of nodes\n", count); >>>>>>> + return 0; >>>>>>> +} >>>>>>> +#endif >>>>>>> + >>>>>>> static void __init >>>>>>> acpi_table_print_srat_entry(struct acpi_subtable_header *header) >>>>>>> { >>>>>>> diff --git a/include/acpi/acpi_numa.h b/include/acpi/acpi_numa.h >>>>>>> index b5f594754a9e..99b960bd473c 100644 >>>>>>> --- a/include/acpi/acpi_numa.h >>>>>>> +++ b/include/acpi/acpi_numa.h >>>>>>> @@ -17,11 +17,16 @@ extern int node_to_pxm(int); >>>>>>> extern int acpi_map_pxm_to_node(int); >>>>>>> extern unsigned char acpi_srat_revision; >>>>>>> extern void disable_srat(void); >>>>>>> +extern int fix_pxm_node_maps(int max_nid); >>>>>>> extern void bad_srat(void); >>>>>>> extern int srat_disabled(void); >>>>>>> #else /* CONFIG_ACPI_NUMA */ >>>>>>> +static inline int fix_pxm_node_maps(int max_nid) >>>>>>> +{ >>>>>>> + return 0; >>>>>>> +} >>>>>>> static inline void disable_srat(void) >>>>>>> { >>>>>>> } >>>>>>> diff --git a/include/linux/numa_memblks.h b/include/linux/numa_memblks.h >>>>>>> index cfad6ce7e1bd..dd85613cdd86 100644 >>>>>>> --- a/include/linux/numa_memblks.h >>>>>>> +++ b/include/linux/numa_memblks.h >>>>>>> @@ -29,7 +29,10 @@ int __init numa_cleanup_meminfo(struct numa_meminfo *mi); >>>>>>> int __init numa_memblks_init(int (*init_func)(void), >>>>>>> bool memblock_force_top_down); >>>>>>> +extern int numa_distance_cnt; >>>>>>> + >>>>>>> #ifdef CONFIG_NUMA_EMU >>>>>>> +extern int emu_nid_to_phys[MAX_NUMNODES]; >>>>>>> int numa_emu_cmdline(char *str); >>>>>>> void __init numa_emu_update_cpu_to_node(int *emu_nid_to_phys, >>>>>>> unsigned int nr_emu_nids); >>>>>>> diff --git a/mm/numa_emulation.c b/mm/numa_emulation.c >>>>>>> index 031fb9961bf7..9d55679d99ce 100644 >>>>>>> --- a/mm/numa_emulation.c >>>>>>> +++ b/mm/numa_emulation.c >>>>>>> @@ -8,11 +8,12 @@ >>>>>>> #include >>>>>>> #include >>>>>>> #include >>>>>>> +#include >>>>>>> #define FAKE_NODE_MIN_SIZE ((u64)32 << 20) >>>>>>> #define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL)) >>>>>>> -static int emu_nid_to_phys[MAX_NUMNODES]; >>>>>>> +int emu_nid_to_phys[MAX_NUMNODES]; >>>>>>> static char *emu_cmdline __initdata; >>>>>>> int __init numa_emu_cmdline(char *str) >>>>>>> @@ -379,6 +380,7 @@ void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt) >>>>>>> size_t phys_size = numa_dist_cnt * numa_dist_cnt * sizeof(phys_dist[0]); >>>>>>> int max_emu_nid, dfl_phys_nid; >>>>>>> int i, j, ret; >>>>>>> + nodemask_t physnode_mask = numa_nodes_parsed; >>>>>>> if (!emu_cmdline) >>>>>>> goto no_emu; >>>>>>> @@ -395,7 +397,6 @@ void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt) >>>>>>> * split the system RAM into N fake nodes. >>>>>>> */ >>>>>>> if (strchr(emu_cmdline, 'U')) { >>>>>>> - nodemask_t physnode_mask = numa_nodes_parsed; >>>>>>> unsigned long n; >>>>>>> int nid = 0; >>>>>>> @@ -465,9 +466,6 @@ void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt) >>>>>>> */ >>>>>>> max_emu_nid = setup_emu2phys_nid(&dfl_phys_nid); >>>>>>> - /* commit */ >>>>>>> - *numa_meminfo = ei; >>>>>>> - >>>>>>> /* Make sure numa_nodes_parsed only contains emulated nodes */ >>>>>>> nodes_clear(numa_nodes_parsed); >>>>>>> for (i = 0; i < ARRAY_SIZE(ei.blk); i++) >>>>>>> @@ -475,10 +473,21 @@ void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt) >>>>>>> ei.blk[i].nid != NUMA_NO_NODE) >>>>>>> node_set(ei.blk[i].nid, numa_nodes_parsed); >>>>>>> - numa_emu_update_cpu_to_node(emu_nid_to_phys, ARRAY_SIZE(emu_nid_to_phys)); >>>>>>> + /* fix pxm_to_node_map[] and node_to_pxm_map[] to avoid collision >>>>>>> + * with faked numa nodes, particularly during later memory hotplug >>>>>>> + * handling, and also update numa_nodes_parsed accordingly. >>>>>>> + */ >>>>>>> + ret = fix_pxm_node_maps(max_emu_nid); >>>>>>> + if (ret < 0) >>>>>>> + goto no_emu; >>>>>>> + >>>>>>> + /* commit */ >>>>>>> + *numa_meminfo = ei; >>>>>>> + >>>>>>> + numa_emu_update_cpu_to_node(emu_nid_to_phys, max_emu_nid + 1); >>>>>>> /* make sure all emulated nodes are mapped to a physical node */ >>>>>>> - for (i = 0; i < ARRAY_SIZE(emu_nid_to_phys); i++) >>>>>>> + for (i = 0; i < max_emu_nid + 1; i++) >>>>>>> if (emu_nid_to_phys[i] == NUMA_NO_NODE) >>>>>>> emu_nid_to_phys[i] = dfl_phys_nid; >>>>>>> @@ -501,12 +510,34 @@ void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt) >>>>>>> numa_set_distance(i, j, dist); >>>>>>> } >>>>>>> } >>>>>>> + for (i = 0; i < numa_distance_cnt; i++) { >>>>>>> + for (j = 0; j < numa_distance_cnt; j++) { >>>>>>> + int physi, physj; >>>>>>> + u8 dist; >>>>>>> + >>>>>>> + /* distance between fake nodes is already ok */ >>>>>>> + if (emu_nid_to_phys[i] != NUMA_NO_NODE && >>>>>>> + emu_nid_to_phys[j] != NUMA_NO_NODE) >>>>>>> + continue; >>>>>>> + if (emu_nid_to_phys[i] != NUMA_NO_NODE) >>>>>>> + physi = emu_nid_to_phys[i]; >>>>>>> + else >>>>>>> + physi = i - max_emu_nid; >>>>>>> + if (emu_nid_to_phys[j] != NUMA_NO_NODE) >>>>>>> + physj = emu_nid_to_phys[j]; >>>>>>> + else >>>>>>> + physj = j - max_emu_nid; >>>>>>> + dist = phys_dist[physi * numa_dist_cnt + physj]; >>>>>>> + numa_set_distance(i, j, dist); >>>>>>> + } >>>>>>> + } >>>>>>> /* free the copied physical distance table */ >>>>>>> memblock_free(phys_dist, phys_size); >>>>>>> return; >>>>>>> no_emu: >>>>>>> + numa_nodes_parsed = physnode_mask; >>>>>>> /* No emulation. Build identity emu_nid_to_phys[] for numa_add_cpu() */ >>>>>>> for (i = 0; i < ARRAY_SIZE(emu_nid_to_phys); i++) >>>>>>> emu_nid_to_phys[i] = i; >>>>>>> diff --git a/mm/numa_memblks.c b/mm/numa_memblks.c >>>>>>> index a3877e9bc878..ff4054f4334d 100644 >>>>>>> --- a/mm/numa_memblks.c >>>>>>> +++ b/mm/numa_memblks.c >>>>>>> @@ -7,7 +7,7 @@ >>>>>>> #include >>>>>>> #include >>>>>>> -static int numa_distance_cnt; >>>>>>> +int numa_distance_cnt; >>>>>>> static u8 *numa_distance; >>>>>>> nodemask_t numa_nodes_parsed __initdata; >>>>> >>>>> >>>>> Best Regards, >>>>> Yan, Zi >>>>> >>> >>> >>> >>> > > > >