From patchwork Tue Jan 28 14:15:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olaf Hering X-Patchwork-Id: 13952583 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 E26F7C0218A for ; Tue, 28 Jan 2025 14:16:45 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.878498.1288684 (Exim 4.92) (envelope-from ) id 1tcmO4-0004kt-3O; Tue, 28 Jan 2025 14:16:20 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 878498.1288684; Tue, 28 Jan 2025 14:16:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tcmO4-0004km-04; Tue, 28 Jan 2025 14:16:20 +0000 Received: by outflank-mailman (input) for mailman id 878498; Tue, 28 Jan 2025 14:16:18 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tcmO1-0004kd-Rx for xen-devel@lists.xenproject.org; Tue, 28 Jan 2025 14:16:18 +0000 Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [85.215.255.21]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 6e01e073-dd82-11ef-99a4-01e77a169b0f; Tue, 28 Jan 2025 15:16:13 +0100 (CET) Received: from sender by smtp.strato.de (RZmta 51.2.17 AUTH) with ESMTPSA id D0534410SEFrwAY (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 28 Jan 2025 15:15:53 +0100 (CET) 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: 6e01e073-dd82-11ef-99a4-01e77a169b0f ARC-Seal: i=1; a=rsa-sha256; t=1738073753; cv=none; d=strato.com; s=strato-dkim-0002; b=SOyMQAtIzj+RwSIcSg6QjiBnex3xT1Ok5vYE8Jag6yer446ZEiuZ4BgL5U7zBnAv/X GueasaoSUJqeup+3hol84AS4h3VQfaVKyIBusPFY1v9Hk3lbzupHovqfr3g1jathHEQH z9KXzncSzZAMiYxk8dtNWF1BmfS03rEs5w8HpukKXMnwzZfypNCVRkyn67Rnf1GY9T1W M9xhWMSSVwOqPKKbi/GuN9xkZ0cHzxvxRn7Xvpe0BAjFsD33TExNugCMzErwk7VgoORd QNG22PxZAYeD2XG26JwL9jsVlDaF9bjrbp5SyDt2eWDZkVRvNCRi/LG4S7ouPO8IU+HB fMGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1738073753; s=strato-dkim-0002; d=strato.com; h=Message-ID:Subject:Cc:To:From:Date:Cc:Date:From:Subject:Sender; bh=6+FFDMnFMkrA8wSKIFiEbNLT+sTX2ENPHcGK1OU85ZQ=; b=GaMGSgR7TgkvNQEH34iKmvWlh3A08beaWVaHay+wwgxNFHSLR9tY9/FVXDc6gI2F5w 408zIR7x9bTOt5MR/fp/9BUyKgagiXM6VbaIQjaoM7UDYZpm06VztaDmrhOFuMIL+q3I qgkjv30wXjCiz1Jfh2AfvTytF2Wcq5Ilz7SVDMHK8JXtg4BxIeOzZZQ/pQYpWHrwnoNe XV2VYK6i2Kkg153S33aB2Mfea58mqcbPN7zNMGXZK34gQzyA6bJ7HICcPxWVhhw2p2xR iyrli/a9W5QJQ2Cqege7eKZzMqdHqMqVQi3Ehcqymar4yNtjMmJxkWbOdM4TDudMqbn5 8KRw== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1738073753; s=strato-dkim-0002; d=aepfle.de; h=Message-ID:Subject:Cc:To:From:Date:Cc:Date:From:Subject:Sender; bh=6+FFDMnFMkrA8wSKIFiEbNLT+sTX2ENPHcGK1OU85ZQ=; b=E+Tv7aCOWB1/OhUhrS7xsRQeiH6XduGJG+OuK3jutS/X00zL1caFicCfrlYUWh7WFr jOk8eFqiPQiNwIKsL4dNulrHtSI5WWfllInD8bH4A2JYfSc/CDo5EucwGnuM0hzEh4+z +dBoibm5+NcCRSVbO7Pn345BHv5O0Fwy+dvQaqdRGZ30hXsyqCS6pproEjy/44AVHjlB WiFXCG9PWv3z89OcxU5auFwghC/ZPJYf9Ye20snA7atfgbhbxvXSr0jWdZX+SE9eXV5j 0ECv6Xa8bksz2qNRXReEpINrt5BXDsORl3CcefL4UKniQlGRVE+78W+CC0Nqj87Zvl0k a37w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1738073753; s=strato-dkim-0003; d=aepfle.de; h=Message-ID:Subject:Cc:To:From:Date:Cc:Date:From:Subject:Sender; bh=6+FFDMnFMkrA8wSKIFiEbNLT+sTX2ENPHcGK1OU85ZQ=; b=DTnr2/AyUXOJF0komU3MnoVlPvFGTpzEJDnPfFNnYS4WnGzIPUdTAiJvSdrNQwZY7p 3DSVayn8QMVlPaQJk9CA== X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QLpd5ylWvMDX3y/OmD4uXd0fmxSoJ8/RK6b07KGriu4yBf+6JptMSdiuOzXC/d" Date: Tue, 28 Jan 2025 15:15:44 +0100 From: Olaf Hering To: "Edgar E. Iglesias" Cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org, jgross@suse.com, Anthony PERARD , Paul Durrant Subject: slow start of Pod HVM domU with qemu 9.1 Message-ID: <20250128151544.26fc827d.olaf@aepfle.de> X-Mailer: Claws Mail (olh) 20240408T134401.7adfa8f7 hat ein Softwareproblem, kann man nichts machen. MIME-Version: 1.0 Hello, starting with qemu 9.1 a PoD HVM domU takes a long time to start. Depending on the domU kernel, it may trigger a warning, which prompted me to notice this change in behavior: [ 0.000000] Linux version 4.12.14-120-default (geeko@buildhost) (gcc version 4.8.5 (SUSE Linux) ) #1 SMP Thu Nov 7 16:39:09 UTC 2019 (fd9dc36) ... [ 1.096432] HPET: 3 timers in total, 0 timers will be used for per-cpu timer [ 1.101636] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0 [ 1.104051] hpet0: 3 comparators, 64-bit 62.500000 MHz counter [ 16.136086] random: crng init done [ 31.712052] BUG: workqueue lockup - pool cpus=1 node=0 flags=0x0 nice=0 stuck for 30s! [ 31.716029] Showing busy workqueues and worker pools: [ 31.721164] workqueue events: flags=0x0 [ 31.724054] pwq 2: cpus=1 node=0 flags=0x0 nice=0 active=2/256 [ 31.728000] in-flight: 17:balloon_process [ 31.728000] pending: hpet_work [ 31.728023] workqueue mm_percpu_wq: flags=0x8 [ 31.732987] pwq 2: cpus=1 node=0 flags=0x0 nice=0 active=1/256 [ 31.736000] pending: vmstat_update [ 31.736024] pool 2: cpus=1 node=0 flags=0x0 nice=0 hung=30s workers=2 idle: 34 [ 50.400102] clocksource: Switched to clocksource xen [ 50.441153] VFS: Disk quotas dquot_6.6.0 ... With qemu 9.0 and older, this domU will start the /init task after 8 seconds. The change which caused this commit is qemu.git commit 9ecdd4bf08dfe4a37e16b8a8b228575aff641468 Author: Edgar E. Iglesias AuthorDate: Tue Apr 30 10:26:45 2024 +0200 Commit: Edgar E. Iglesias CommitDate: Sun Jun 9 20:16:14 2024 +0200 xen: mapcache: Add support for grant mappings As you can see, v4 instead of v5 was apparently applied. This was probably unintentional, but would probably not change the result. With this change the domU starts fast again: I did the testing with libvirt, the domU.cfg equivalent looks like this: maxmem = 4096 memory = 2048 maxvcpus = 4 vcpus = 2 pae = 1 acpi = 1 apic = 1 viridian = 0 rtc_timeoffset = 0 localtime = 0 on_poweroff = "destroy" on_reboot = "destroy" on_crash = "destroy" device_model_override = "/usr/lib64/qemu-9.1/bin/qemu-system-i386" sdl = 0 vnc = 1 vncunused = 1 vnclisten = "127.0.0.1" vif = [ "mac=52:54:01:23:63:29,bridge=br0,script=vif-bridge" ] parallel = "none" serial = "pty" builder = "hvm" kernel = "/bug1236329/linux" ramdisk = "/bug1236329/initrd" cmdline = "console=ttyS0,115200n8 quiet ignore_loglevel"" boot = "c" disk = [ "format=qcow2,vdev=hda,access=rw,backendtype=qdisk,target=/bug1236329/sles12sp5.qcow2" ] usb = 1 usbdevice = "tablet" Any idea what can be done to restore boot times? Olaf Signed-off-by: Stefano Stabellini --- a/hw/xen/xen-mapcache.c +++ b/hw/xen/xen-mapcache.c @@ -522,6 +522,7 @@ ram_addr_t xen_ram_addr_from_mapcache(void *ptr) ram_addr_t addr; addr = xen_ram_addr_from_mapcache_single(mapcache, ptr); + if (1) if (addr == RAM_ADDR_INVALID) { addr = xen_ram_addr_from_mapcache_single(mapcache_grants, ptr); } @@ -626,6 +627,7 @@ static void xen_invalidate_map_cache_entry_single(MapCache *mc, uint8_t *buffer) static void xen_invalidate_map_cache_entry_all(uint8_t *buffer) { xen_invalidate_map_cache_entry_single(mapcache, buffer); + if (1) xen_invalidate_map_cache_entry_single(mapcache_grants, buffer); } @@ -700,6 +702,7 @@ void xen_invalidate_map_cache(void) bdrv_drain_all(); xen_invalidate_map_cache_single(mapcache); + if (0) xen_invalidate_map_cache_single(mapcache_grants); }