From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 690FF98A6 for ; Thu, 3 Aug 2023 15:56:38 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4C2E9451E for ; Thu, 3 Aug 2023 15:56:38 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 3 Aug 2023 15:56:34 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 560264266E for ; Thu, 3 Aug 2023 15:56:34 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Thu, 3 Aug 2023 15:56:30 +0200 Message-Id: <20230803135630.329820-1-f.ebner@proxmox.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.044 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH qemu] add patch fixing fd leak for vhost X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2023 13:56:38 -0000 Each pause+resume operation (which is also done as part of taking a VM snapshot) would increase the number of open file descriptors by the number of vhost devices (e.g. network devices by default). This could lead to crashes during backup and surely other issues once the system limit (default 1024) was reached [0]. [0]: https://forum.proxmox.com/threads/131603/ Signed-off-by: Fiona Ebner --- .../extra/0011-vhost-fix-the-fd-leak.patch | 29 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 30 insertions(+) create mode 100644 debian/patches/extra/0011-vhost-fix-the-fd-leak.patch diff --git a/debian/patches/extra/0011-vhost-fix-the-fd-leak.patch b/debian/patches/extra/0011-vhost-fix-the-fd-leak.patch new file mode 100644 index 0000000..31392fb --- /dev/null +++ b/debian/patches/extra/0011-vhost-fix-the-fd-leak.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Li Feng +Date: Mon, 31 Jul 2023 20:10:06 +0800 +Subject: [PATCH] vhost: fix the fd leak + +When the vhost-user reconnect to the backend, the notifer should be +cleanup. Otherwise, the fd resource will be exhausted. + +Fixes: f9a09ca3ea ("vhost: add support for configure interrupt") + +Signed-off-by: Li Feng +Reviewed-by: Raphael Norwitz +--- + hw/virtio/vhost.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c +index a266396576..8e3311781f 100644 +--- a/hw/virtio/vhost.c ++++ b/hw/virtio/vhost.c +@@ -2034,6 +2034,8 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev, bool vrings) + event_notifier_test_and_clear( + &hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier); + event_notifier_test_and_clear(&vdev->config_notifier); ++ event_notifier_cleanup( ++ &hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier); + + trace_vhost_dev_stop(hdev, vdev->name, vrings); + diff --git a/debian/patches/series b/debian/patches/series index a4dd4c2..74578f6 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -8,6 +8,7 @@ extra/0007-bcm2835_property-disable-reentrancy-detection-for-io.patch extra/0008-raven-disable-reentrancy-detection-for-iomem.patch extra/0009-apic-disable-reentrancy-detection-for-apic-msi.patch extra/0010-migration-block-dirty-bitmap-fix-loading-bitmap-when.patch +extra/0011-vhost-fix-the-fd-leak.patch bitmap-mirror/0001-drive-mirror-add-support-for-sync-bitmap-mode-never.patch bitmap-mirror/0002-drive-mirror-add-support-for-conditional-and-always-.patch bitmap-mirror/0003-mirror-add-check-for-bitmap-mode-without-bitmap.patch -- 2.39.2