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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6E087CAC58E for ; Thu, 11 Sep 2025 15:46:31 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1120503.1465419 (Exim 4.92) (envelope-from ) id 1uwjV8-0001st-1k; Thu, 11 Sep 2025 15:46:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1120503.1465419; Thu, 11 Sep 2025 15:46:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwjV7-0001sm-V4; Thu, 11 Sep 2025 15:46:21 +0000 Received: by outflank-mailman (input) for mailman id 1120503; Thu, 11 Sep 2025 15:46:20 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwjV5-0001sb-W7 for xen-devel@lists.xenproject.org; Thu, 11 Sep 2025 15:46:19 +0000 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on20600.outbound.protection.outlook.com [2a01:111:f403:2009::600]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 74896bad-8f26-11f0-9d13-b5c5bf9af7f9; Thu, 11 Sep 2025 17:46:18 +0200 (CEST) Received: from BL1PR13CA0113.namprd13.prod.outlook.com (2603:10b6:208:2b9::28) by SA3PR12MB7781.namprd12.prod.outlook.com (2603:10b6:806:31a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Thu, 11 Sep 2025 15:46:13 +0000 Received: from BN2PEPF000055DC.namprd21.prod.outlook.com (2603:10b6:208:2b9:cafe::96) by BL1PR13CA0113.outlook.office365.com (2603:10b6:208:2b9::28) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9137.8 via Frontend Transport; Thu, 11 Sep 2025 15:46:13 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by BN2PEPF000055DC.mail.protection.outlook.com (10.167.245.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9137.0 via Frontend Transport; Thu, 11 Sep 2025 15:46:13 +0000 Received: from localhost (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Thu, 11 Sep 2025 08:46:09 -0700 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 74896bad-8f26-11f0-9d13-b5c5bf9af7f9 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=e1u3LApDYszOTEma88lL46zxbHQhLkO0HRq583UzgeIfnMyRcPUFDYuS+UWUmfXvRsP15/WsAKJC+APpeoElUtM78X2j+YMAfQ/lJyYqi3hYpEUQCjEuy3/Cew2O3mIRgzTcnuLuMGXxIaXexVQQ2Qi8MaNZajFtH713XwUo+O/QUR4jmdT7EhuAKL81zzfa9I7HFIjBggmIPlhVTWt4FtF1/6NjDMdz8EuKGEfaU4oxnx08CRxQEi8rATyYGovX590zJOk1Shm+6KXI1ZY5dacx7e7pVAjwFPptplZqlXrNmgpC3+O7fyaS6pEJOQNAsB6K/uGxL41lpX+nLkllJw== 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=1GKoceEeRTsg1YvJtSF0BHGnKeYr1esTx0wBbEOPykQ=; b=iCDBYxuQVOzEtH5rosJwVYxGPWPLurWk9z8E2usiuYo+mmB9qZAGQmlSilSI42bhbTPiE4mpmfjEAy/fDXqDVPyKIScxouvImVxRYB0eDBeJ8rU1WneC6DcwBpHxtxgAr+XZ21IhdnnRKDHEaN8adcrC6yM/33lOnMJdI12tYuFfGGe3TCYr07DBuIvxuDrYHo4IWjfgvtgV+MRieAi8CkkdR5C4GiPly4iwkq0Rl0Cb+cStRTsxCHgTY9OB1uVvO8cjW6SdfbqcKnJQPCKLcr7PU8vl6J7qv1PPvShTQMWytaO5d83lua2x0Mhs8mkqDNmqNh4C/qyHjPJodkKa9A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1GKoceEeRTsg1YvJtSF0BHGnKeYr1esTx0wBbEOPykQ=; b=ns+9JQ6EhZONsehp0bH8BWZGlT79oOazrzG8+WZ0ddmlSdKbwhC8YvmIh0YwORChkiBbQ+lbm7rfv50cEjZTqHJKTLEHtQdALKFi0JWNSA7Rv2bLNxJcHARg6jl0FY01523E88XPtzaq7tzblb+dZDBEYZWGuEhIUZXJb+Uh++g= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Date: Thu, 11 Sep 2025 17:46:08 +0200 Message-ID: From: Alejandro Vallejo To: Jan Beulich , Andrew Cooper , Jason Andryuk CC: Xen-devel , Xen-devel Subject: Re: domU reboot claim failed X-Mailer: aerc 0.20.1 References: In-Reply-To: X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000055DC:EE_|SA3PR12MB7781:EE_ X-MS-Office365-Filtering-Correlation-Id: 301d1f7b-331d-4500-e19a-08ddf14a566b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?utf-8?B?SXV2OStzVlE5VW9uelFoV1pockRLcktqVm1xamFLRUp6WEdBUjdaMGd3VGxh?= =?utf-8?B?Q0Q1SVk4NkRJbkZRY29zMU0reU9WSkZSd2pkVW9xYm44SEYxK3hLUDIyc2dr?= =?utf-8?B?d2VqTENHendxRk0zS2VFWnA5RmlRVlNTZEp2R091WHQ5NHR4S1R2YkRlanRK?= =?utf-8?B?SitUQndlMjF5a0JZanNjbnlEelhQWWdRK0thSkhIRENKbWhsSEUvSXJPaWZ5?= =?utf-8?B?NEVYZU9CVlRIUFVTYzlGQjkyZ2NVL1NMN3UvVVhnU3lxb2JHNGw4OGpOT0NQ?= =?utf-8?B?Qk5VOEVNczAyZXQ2QlNXdHkwQUIySUgxRG1BbFBGTHp1R3o4Y0p4ZEZaTDZW?= =?utf-8?B?Z3ZCd2hiTnoxdXh4M1ZtcTN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)(1800799024)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2025 15:46:13.5843 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 301d1f7b-331d-4500-e19a-08ddf14a566b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000055DC.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7781 On Thu Sep 11, 2025 at 9:55 AM CEST, Jan Beulich wrote: > On 10.09.2025 23:57, Andrew Cooper wrote: >> On 10/09/2025 7:58 pm, Jason Andryuk wrote: >>> Hi, >>> >>> We're running Android as a guest and it's running the Compatibility >>> Test Suite.=C2=A0 During the CTS, the Android domU is rebooted multiple= times. >>> >>> In the middle of the CTS, we've seen reboot fail.=C2=A0 xl -vvv shows: >>> domainbuilder: detail: Could not allocate memory for HVM guest as we >>> cannot claim memory! >>> xc: error: panic: xg_dom_boot.c:119: xc_dom_boot_mem_init: can't >>> allocate low memory for domain: Out of memory >>> libxl: error: libxl_dom.c:581:libxl__build_dom: xc_dom_boot_mem_init >>> failed: Cannot allocate memory >>> domainbuilder: detail: xc_dom_release: called >>> >>> So the claim failed.=C2=A0 The system has enough memory since we're jus= t >>> rebooting the same VM.=C2=A0 As a work around, I added sleep(1) + retry= , >>> which works. >>> >>> The curious part is the memory allocation.=C2=A0 For d2 to d5, we have: >>> domainbuilder: detail: range: start=3D0x0 end=3D0xf0000000 >>> domainbuilder: detail: range: start=3D0x100000000 end=3D0x1af000000 >>> xc: detail: PHYSICAL MEMORY ALLOCATION: >>> xc: detail:=C2=A0=C2=A0 4KB PAGES: 0x0000000000000000 >>> xc: detail:=C2=A0=C2=A0 2MB PAGES: 0x00000000000006f8 >>> xc: detail:=C2=A0=C2=A0 1GB PAGES: 0x0000000000000003 >>> >>> But when we have to retry the claim for d6, there are no 1GB pages used= : >>> domainbuilder: detail: range: start=3D0x0 end=3D0xf0000000 >>> domainbuilder: detail: range: start=3D0x100000000 end=3D0x1af000000 >>> domainbuilder: detail: HVM claim failed! attempt 0 >>> xc: detail: PHYSICAL MEMORY ALLOCATION: >>> xc: detail:=C2=A0=C2=A0 4KB PAGES: 0x0000000000002800 >>> xc: detail:=C2=A0=C2=A0 2MB PAGES: 0x0000000000000ce4 >>> xc: detail:=C2=A0=C2=A0 1GB PAGES: 0x0000000000000000 >>> >>> But subsequent reboots for d7 and d8 go back to using 1GB pages. >>> >>> Does the change in memory allocation stick out to anyone? >>> >>> Unfortunately, I don't have insight into what the failing test is doing= . >>> >>> Xen doesn't seem set up to track the claim across reboot.=C2=A0 Retryin= g >>> the claim works in our scenario since we have a controlled configuratio= n. >>=20 >> This looks to me like a known phenomenon.=C2=A0 Ages back, a change was = made >> in how Xen scrubs memory, from being synchronous in domain_kill(), to >> being asynchronous in the idle loop. >>=20 >> The consequence being that, on an idle system, you can shutdown and >> reboot the domain faster, but on a busy system you end up trying to >> allocate the new domain while memory from the old domain is still dirty. >>=20 >> It is a classic example of a false optimisation, which looks great on an >> idle system only because the idle CPUs are swallowing the work. > > I wouldn't call this a "false optimization", but rather one ... > >> This impacts the ability to find a 1G aligned block of free memory to >> allocate a superpage with, and by the sounds of it, claims (which >> predate this behaviour change) aren't aware of the "to be scrubbed" >> queue and fail instead. > > ... which isn't sufficiently integrated with the rest of the allocator. > > Jan That'd depend on the threat model. At the very least there ought to be a Kconfig knob to control it. You can't really tell a customer "your data is gone from our systems" unless it really is gone. I'm guessing part of the rationale was speeding up the obnoxiously slow destroydomain, since it hogs a dom0 vCPU until it's done and it can take many minutes in large domains. IOW: It's a nice optimisation, but there's multiple use cases for specifica= lly not wanting something like that. Cheers, Alejandro