From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 7505A811BB for ; Thu, 5 Nov 2026 12:55:53 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6A5CscYr005028; Thu, 5 Nov 2026 15:54:39 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A5CscYr005028 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="rjvShu/w" Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6A5CsQf2005005 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 5 Nov 2026 15:54:27 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A5CsQf2005005 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-490ab0a20ebso1140891f8f.1 for ; Thu, 05 Nov 2026 04:54:27 -0800 (PST) X-Gm-Message-State: APuU4Z+j4Ld792khAUuDPtVbrw33xWokDKcoWqrQctKqmsScHNnzKmN6 n3pm9RT0hzmXak7l/7Kd20F+yKlEyD0WSmLw/40EpPcMLQMUZjitN1gviEl7m4Ba5Ijunueu1fT asDYbDfsEIbD3aT48BP8XjrIhp8Ye7ibqI9qx1JuSclbNimX7A8qVZw== X-Gm-Gg: AYBFou3e1brkFxzVqQ4cmoMOFpjz49tIZVXSRo14aPWyRakwfFA8WcT7HjpbHVB3hIh w+7D7wJLvP0mR0Y7FaUy26vaZEoCY29NZqQuFJSGnjjCfKlDIFK7yWYs9QmYx95LirTqyMuF+pX HxTZBybtmkvpdoqrDIJFEc6KJ06z6ZBlYZoXyfb3fE43uc9OTLJgm81QJEqgGj1PfO2XAasQqME TSyhIyMAfl+ONz/a8mCrWGoVlSHP/n8AKgBEkGZ+OudkphoQ5dvsO1osj/2wkU6jP+fsBb5z1X7 ITjaAJycsLjWpzQqaiAdnwz5KKoRZWEwQAz1hikIb4yEW/+ZImfo6JQVJnS34eO2xm5UGyiK0dW bCZnRvBEA4aRgGNUpBw== X-Received: by 2002:a05:6000:2dc3:b0:48e:68da:1c5c with SMTP id ffacd0b85a97d-48e6e2f83aamr41509510f8f.16.1793883266429; Thu, 05 Nov 2026 04:54:26 -0800 (PST) X-Received: by 2002:a05:6000:2dc3:b0:48e:68da:1c5c with SMTP id ffacd0b85a97d-48e6e2f83aamr41509454f8f.16.1793883265939; Thu, 05 Nov 2026 04:54:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793883265; cv=none; d=google.com; s=arc-20260327; b=EgVHrzHGlow5bxr5g6tCsYjypDBuxuWn0urVuGi61rjmcNBUdfpjv5uxEpqljYfnQj qUd2kaLjxPpSsy75s/2eYMrG+tW/mUHhueohOsd07tpXDZQt9Pyv2Go7NS502CUSqipD CGSsG+GVlBU5Mvgv0EhELUJKzNYk1gPXEJs1ZF0Zl+ZPWyi/D0XmiMd3wBfKc84ri/62 hon2awZWaNCTXBhFT4OYOo6Q/AtmkeKsJ+kZK1lRWdGQNSLAOGHPRXcCmvebQp0p05eh tZ3FcheI+RdwXsU4vXfN/0rdtPlQAnB95LgeNHpFL6zA6LaurtvQk3JSGOel7HPh4/eC yOYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=message-id:date:references:in-reply-to:cc:to:from:subject :content-transfer-encoding:mime-version:dkim-signature; bh=2Lakb+z5+Czuzfd5fJ5T+i/Qcf6lDCMPTB6gKmLiWlw=; fh=5AmFLEo6nHxL6WDW39LXC01IwU+CKjcYMpOuqqVTSIM=; b=oAU3fRdwuoQtxI7NyyVaUcihJNFbBT6f//kaez4UziB1L9Z4Fz9t6ln1f8VcH3VpSQ /fsIiw0oTPn0PhxONXLfIwgWYuX15ka1hzj/SDvCwjA2pPVfPxLQwPlH2WS+iSjCNY8w zeCI5aXYqKVdvXcGfFAiF87seORhdYBR/ThwVFa3IjvDbRm/WRo1YxQajTn96mj7vOwQ cme1xNanyYxNTOPTm9PQxwMcpx+SqCv7iH/JAMaEawjhTQNk+dNZgM1h+Znqrk3L03Hn 7Cr8t13uwVgmeVd2dD/vWNhZnjYyUlnG6dTid+XWqxcaTFJAVWLoU33CugMC1lyVLULj kC6Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b="rjvShu/w"; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-48fed928413si10378124f8f.177.2026.11.05.04.54.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 04:54:25 -0800 (PST) Received-SPF: pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b="rjvShu/w"; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Message-Id:Date:From:Subject:Content-Type: MIME-Version; bh=2Lakb+z5+Czuzfd5fJ5T+i/Qcf6lDCMPTB6gKmLiWlw=; b=rjvShu/wT2XJ 81pQ6jdWuLFgLUDXiSvATTPRUq75HC1KV1OFXAEhK6r1NhdrZ8lH1ZcrM7VA9yoIdY6ZIIN7HhEU+ mRyzNyQJjCj7bQvfayaDFxBlWz8/6+TV+dTMWIEyYFLxHEmr6xdnu9SUQFzxeJPJu4JskR6NsVTls FYmjRPTSEA5XeKKiNul+CC3KXpVaAlGGNz6KQ0On1yjSDEwvOg1TSIBWZI+vyU7lqm76uleFnh/jp WEp3ArGbS6fw3V8bgI3F2WJ6LjrW+cODDCL67Rx9Xnb9wuFlmNJrdtKzwe5dYfAm4x5j5K7N8TF97 7mrsIp7ffkfZMqtvS+ol6w==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=f0.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1xOwv4-000XtP-2p; Thu, 05 Nov 2026 13:54:22 +0100 MIME-Version: 1.0 From: Konstantin Khorenko To: Andrey Drobyshev In-Reply-To: <20261105121733.643754-3-andrey.drobyshev@virtuozzo.com> References: <20261105121733.643754-1-andrey.drobyshev@virtuozzo.com> <20261105121733.643754-3-andrey.drobyshev@virtuozzo.com> Date: Thu, 05 Nov 2026 13:54:22 +0100 Message-Id: <179388326206.2823727.14139220407513128940.b4-review@b4> X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2172; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=LyB57Cj7Zk4xoHiTVujCoH/ViSy79QvqMibadS5Gl5w=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBq7HyA0r5M54EZNYCUgka2JDT95bLaOXwjhL6iT 4JPGYIuUJOJAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCaux8gAAKCRBRlgpH+WFc KmOJEACcOr22V38efVp3RheFCTmJ12RrLoL4/72aXuFytVhNRhzD1jbY8R2gqj0jnVYEirUBe2w cfDrrm7VgWXjfpVdTvFWB2RUCWgKX0QLwg974kS8lU7SghHAjlhNzbPwue+fMM9WQI3qOLc8Mf0 YD/D58dNXCHxbVDK1en+aQ45d1OPkQACBSTzk9sfADObMI5Hx2h6BbsJXQ/gBB3eDSj7Zun8K6K aPFP5OWp/MFF8ut+vLYlCXnnYsSg2UqIBRkzH7bAI+NOsXblFMtxZjjPQeBPc8A5nE5+qz71hsD PxY8NRBQKA2Jlcx/xwPOXhaGSMGYO73lXHkwP+tdpKkryDjbBkOQ12bOByQ8BFaFrdtkTY52Y0T NXuhyH0S/yAPboJaaOg65RBl+hlL5yx0QWfr1BNU+Rnwswq9BUn95e5NX/PioxkPGnw4M3T7zWT k6ujb/WacsSRlWWgUpB91mlUTf2o7+tMkSo2Qmxc/qSn+1POOiaZ5Q+nV4pXyNFrcABCstLHBNx GK5neo2HQFwy2URlldr3oMe48xE47r/AKbqjlbN28w8vkHOtA0TnU8RK97DuxFRxB/Ru9fbizcN 55+m14qyeJ3T38hMJDHf3tuXkdXG8SkOTAcQ4uiPnFkn0dU3FYkqgx9t9YVhSZOqgLVvjoiFBh/ Qv0mayoWm+5nA5w== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Cc: devel@openvz.org Subject: Re: [Devel] [PATCH hci-8.1 2/2] KVM: remove the VM's debugfs directory when its fd is released X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org I won't apply this version, please send v3 with the changes below. On Thu, 5 Nov 2026 14:17:33 +0200, Andrey Drobyshev wrote: > removed only together with the VM. A VM can outlive its fd: VFIO keeps > a reference to it for an open passthrough device, and QEMU's cpr-exec > closes the fd and creates a new VM in the same process, often on the > same fd number. The new VM then finds its directory taken, logs > "duplicate directory" and runs without debugfs stats. Seen on every > other live update of a vGPU VM. Item 3 of the cover letter reply: test patch 1 alone. If the duplicate directory is gone, drop this patch. If not, name in the message what still holds the old VM. Why: with patch 1, VFIO takes no kvm reference for nvidia-vgpu-vfio. The VM fd, the vcpu fds and the device fds are all close-on-exec. So on cpr-exec the old VM is destroyed, and its directory removed, before the new QEMU creates its VM. What can still hold a VM past its fd is KVMGT, vfio_ap, zdev, a guest_memfd fd or an open stats file, and none of the three drivers is built in our x86_64 kernels. > + /* The directory is named after this fd, which is free to reuse now */ > + kvm_remove_vm_debugfs(kvm); Item 4 of the cover letter reply: if the patch stays, rename the directory with debugfs_change_name() to a name that cannot clash, instead of removing it. Then drop the "Two things change" paragraph. Why: on powerpc the XICS and XIVE devices create a file in this directory and remove it when their device fd is released. If the VM fd is closed first, the recursive removal here frees that dentry, and the device release then removes freed memory. Our x86_64 kernels are not hit, but the code should not carry that. My v1 reply asked to remove only the directory and missed this case, sorry. A rename keeps every child dentry valid until kvm_destroy_vm(), and STATS_PATH and the vcpu stats keep working. > Feature: fix ms/kvm > > Assisted-by: LLM Item 5 of the cover letter reply: drop the Assisted-by line here, it goes into the cover letter. Put a blank line before Feature:. -- Konstantin Khorenko, Virtuozzo Linux Kernel Team _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel