From nobody Mon Mar 4 12:07:18 2024 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TpHWC2yHWz5CVCQ for ; Mon, 4 Mar 2024 12:07:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TpHWC1f50z4wwf for ; Mon, 4 Mar 2024 12:07:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709554039; a=rsa-sha256; cv=none; b=jOFYMWIr1RBHQUb9kkpcfODPSP/aHWSF61hHE4g2gULvXIApmPrqc3nc9QAfwqY3KyaMoU O22uM3hJkgHWl3PK8oybZyfurP2qIhdQ06dT0pyxNINxMf+xSbQxUUN1lNM0Qgkm43Vbzu PP+TW8IdJdM3fERPfdL+fBJc4Dn0wKXs8o21f/k1lvHl5mcKreRVRIal564h9roBo6nOwD MU9sAchOp7rgRGFrE5/iQGPm8Bca2CbXMzUxLTa+aNRr6EHhSG4UqAjIGyhB5o2LFOBbiE Ch9HQWpL+D29LrG6V3FD9JIAaI9NNITJK1hxu+AO1HxyhYzquAdgvHMCL/XqSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709554039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Es6Zg39GJawxhMnpIfZqVx7B1Mu6nZc7VR0QDJ0kKgQ=; b=TTLZh7rbogVbR7mnINOCUXxKenEXfam3n9ISievBm8o7J8zQKgdHaEd33ZF5KMJe5MAhy1 qnlVxtYCha+r9TZM5z66Opla7X0VxiqAEJtRdeg5kMZWjM02AomfRCcbwQwmZ3SR3v+AtG 9QC+5Qwu5+E45J/ltcPN2Y320Lx9DnqycRrQFtSD6tY5CutoZm6lRHcKrCXaalq0OdGpFn nvjzRB3RUeSvl+d7+5jxr2syRTaIjIQ345w4Nm608D7bJLhk5P3grFrvVlB2uNQrQJ1TB3 bQoA5JeK6KoJs9WwpggzkvRxYZsu2tLTjJZqHXl+d7sRiLrz/BTNRTcc/deOKA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TpHWC17LVzLbN for ; Mon, 4 Mar 2024 12:07:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 424C7Jlc091284 for ; Mon, 4 Mar 2024 12:07:19 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 424C7JPC091283 for bugs@FreeBSD.org; Mon, 4 Mar 2024 12:07:19 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 277473] Virtio memory ballooning does not return unused memory to host Date: Mon, 04 Mar 2024 12:07:18 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 14.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: laurent.chardon@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D277473 Bug ID: 277473 Summary: Virtio memory ballooning does not return unused memory to host Product: Base System Version: 14.0-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: laurent.chardon@gmail.com The memory ballooning in a FreeBSD kvm/qemu guest does not seem to return t= he unused memory to the host.=20 The ballooning seems to happen correctly within FreeBSD, but the host might= not be told properly (that's only my limited understanding as a non-expert). This is true whether setting the current memory size automatically of manua= lly. Here are some scenarios to explain the problem. =3D=3D=3D Scenario 1 With currentMemory and memory both set to 64GB in the kvm config file $ vmstat procs memory page disks faults cpu r b w avm fre flt re pi po fr sr nd0 pa0 in sy cs us sy = id 0 0 0 429M 62G 2.3K 0 17 0 3.4K 4 0 0 76 2.2K 1.3K 0 1 = 99 neofetch shows: Memory: 2272MiB / 65495MiB On the Linux host, top shows: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMM= AND 57685 libvirt+ 20 0 66.8g 64.2g 26112 S 0.0 51.1 1:01.37 qemu-system-x86 This is all as expected=20 =3D=3D=3D Scenario 2 With currentMemory set to 8G and memory set to 64GB in the kvm config file $ vmstat procs memory page disks faults cpu r b w avm fre flt re pi po fr sr nd0 pa0 in sy cs us sy = id 0 0 0 429M 5.7G 3.1K 0 23 0 4.6K 4 0 0 1381 3.0K 3.5K 0 4 = 96 and now neofetch shows: Memory: 59607MiB / 65495MiB On the Linux host from the 'top' command: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMM= AND 57062 libvirt+ 20 0 66.8g 64.2g 26112 S 0.0 51.0 1:32.51 qemu-system-x86 vmstat shows less available memory than in Scenario 1, as expected. The host however sees no difference in memory usage from FreeBSD compared to Scenario 1. Expected: the memory usage on the host should have decreased.=20 Interestingly, neofetch sees much more memory usage than previously. I don't know if it's relevant, but it might be a clue so I'm including this here. =3D=3D=3D Scenario 3 With currentMemory and memory both set to 64GB in kvm config file, as in Scenario 1. I type 'sudo virsh setmem FreeBSD 8G' on the host. FreeBSD's vm= stat initially shows 64G free, and transitions gradually to 5.7G free, as expect= ed.=20 On the host side however, there is no change in the memory utilization of t= he FreeBSD VM. Expected: the memory usage on the host should have decreased.=20 =3D=3D=3D Test notes The tests are done on a physical server with 32 cores (2 sockets), 64 threa= ds, 128GB RAM.=20 The OS is Ubuntu 22.04 Other guests such as Windows and Linux behave as expected in kvm/qemu. The memory usage inside the guest matches the memory usage seen from the host. virtio_balloon.ko is compiled in kernel. --=20 You are receiving this mail because: You are the assignee for the bug.=