From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F49836C5A1 for ; Tue, 16 Jun 2026 14:23:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781619814; cv=none; b=UlGSV/hgIBP4za3d19rWsnm4Ii2vgP83U6nQan94h6GUpksvIF2EcWoK71BC1Gnpzrv85wFaWOlc5QpeKJF3S+xaV1VWe2Ho24QOkU1ky4lbSI6PDticvB43UniixomAN/VQbrkpHUg5yrEwqEm4Pfcp57z6DPsS0CjF+wx9Njs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781619814; c=relaxed/simple; bh=Q/s4cDWwwN/dicrkzT22yRozV+e/TzvwUha5L7N8yA4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pfXPBnFpo0e3rrQLEhJlhuenUdUCT34SKXOO4D0bO1AQtHK0JhX8IOWtXLjn5qjXAlKJ+s4knqvIN5jh+nw7LUUxhQT8B2YK5UqWajXl3RDh+DHNivnPKAUKuwrxgqipCmcsWmdrK+VsAAMjm/a9fqb4R2iYI+fi03KndmzAT5s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=a5fV6wOl; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=kg+lf2TS; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="a5fV6wOl"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="kg+lf2TS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781619810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7mn5V4o1TPXbSAVtdGS76DREOft6jWX1FbZbmYVpiyU=; b=a5fV6wOlAnUvq9OcNiADJjYWaC/RfuuE8MXZYvqzxk3Ob++cp+2IYDs2Rxl/AZ6mXldtjk wJ+ojCJ6hFfasuac7wvGb6zIZuAmWV+1edHWe3FGrt0C0ImPYg48Gd4cZJsZt76y5S282L DJWirJ2GvsUam41qZa6ZtZsvzNssOfo= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-501-vADahaoeOw6aRu1OL2JikQ-1; Tue, 16 Jun 2026 10:23:29 -0400 X-MC-Unique: vADahaoeOw6aRu1OL2JikQ-1 X-Mimecast-MFC-AGG-ID: vADahaoeOw6aRu1OL2JikQ_1781619808 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-490aadb1386so28154805e9.0 for ; Tue, 16 Jun 2026 07:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1781619808; x=1782224608; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=7mn5V4o1TPXbSAVtdGS76DREOft6jWX1FbZbmYVpiyU=; b=kg+lf2TSjV3/MHWhd4dmf31HVzOWM+Bn0fiiZh1UEe/SG5xV25UImuctwwThSbcWI1 qEIVbEWHDHGGrjCffLAyLuW5G1SUoJM+Cr/sz1+lLl2YsqPvsxCQiamxU73P6Wf+0bzH g7H5wYdutvFfkp0O7SOfvncYkLX3ZVdu/FkeAtUjviEW8OGcfNyAcuDPPJRadO6L/ThN cS+MU2SVoAkF7P/pFofzUKUiqkYVJ4D+K+RCMkxYWcpk13BDXTR0yXFk30QL/vnyAwSI uskDoWvqrGTyyj4twOedg+VuCiXHPpZBM3kb+BCOHgsZKQKQpo0UKW2zLYSF2eVVTbl3 8Y2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781619808; x=1782224608; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7mn5V4o1TPXbSAVtdGS76DREOft6jWX1FbZbmYVpiyU=; b=K4yqrLc1VOgr/Gu36Z5p4QcL9+rV1jCXulu4QUD8Vi65SDWuYvxdvwYW8ZK9wWtYz1 iopq1lO3Cz73p04WkeJWEm6rYR+K7/cRC4fuNiQnFS/Ezri7+aEzJpzHAAVnasbAtTdE YNVmCANndJqAfCDju0kEAHaayw6tMjygza3srxVA3pdZDSxSQaGdP/5BMttv1jowf4og kC2fGLD/6EQAnmoTZrXzsSpKoSTCPMUdcPZrHmtAfZYOUBv6Qp2F8q6hW9T5TLUkA/ws D0jxCIczVkFfMPDR9mwcJGpqpyq5aETeDl78bxH9k8NWGJ7Ed6fee15T5dGCXjw5tT3l kE4w== X-Gm-Message-State: AOJu0YwKFzU7P182BmAqlbxu1uRupBoMwK3O08ydGzJJZKwxXBWWlXmW z8QZ6o4TDi82ceHMEfZ3osX+l2qxGgUk7Gc+5eznIf2MRbxVjbU0YrKgn3I7jpKbETn6U70XfBG 7sOXu41TP9pgLCsY8u1+iEc5grWz7H8y+0q8rrXJv5aEfOqHuIxzLBmIO79eLVAAwVg== X-Gm-Gg: Acq92OFviyRR1xIhvLbS1CUvVpCM3JmURIpO4mWeUgiY4wtzP836l6Q3QUQMt8PHy/Z R8l1tzVVBUojNZ37aGp3BfOuu1cGvfkJwbt+3ogdbp9B1IdAotSAvJKL8ynKxClMcdPMMYNUrwS UUdBNx9SDOBa2YqgC97+GZyFAi+bUda+z7P3iLZr+wwkEW0Xec0W31P8Qx4jYi7WyqcpAGJ/JIo heQXMRf/QnUjTcswM2rt3/AnkgJS6Zrh6JLikQ1ZsJdzRW6TpH7hw0Cob0uSgP+xNH3reGyf/7R 35Js2prV9/NgolM+O74oQCjLeAjOVpGVzBEm1w/9Rf9YxxQGatqXeBwROuMGaIqdRPfeyy26bpM /6g8G5gKakMAMIDGXYmoV6lakt1z3yqVBkCHNzOUMGdhWNySRwKKA4S7KHOKTiMQegobj9mM= X-Received: by 2002:a05:600c:6215:b0:490:e180:2e0 with SMTP id 5b1f17b1804b1-4922fab22c9mr58482985e9.3.1781619807823; Tue, 16 Jun 2026 07:23:27 -0700 (PDT) X-Received: by 2002:a05:600c:6215:b0:490:e180:2e0 with SMTP id 5b1f17b1804b1-4922fab22c9mr58482265e9.3.1781619807299; Tue, 16 Jun 2026 07:23:27 -0700 (PDT) Received: from sgarzare-redhat (host-82-53-135-12.retail.telecomitalia.it. [82.53.135.12]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ea95c512sm243782055e9.2.2026.06.16.07.23.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2026 07:23:26 -0700 (PDT) Date: Tue, 16 Jun 2026 16:23:11 +0200 From: Stefano Garzarella To: Andrey Drobyshev Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux.dev, netdev@vger.kernel.org, mst@redhat.com, stefanha@redhat.com, maciej.szmigiero@oracle.com, bchaney@akamai.com, mark.kanda@oracle.com, ptikhomirov@virtuozzo.com, den@openvz.org Subject: Re: [PATCH 4/4] vhost/vsock: re-scan TX virtqueue on device start Message-ID: References: <20260612165718.433546-1-andrey.drobyshev@virtuozzo.com> <20260612165718.433546-5-andrey.drobyshev@virtuozzo.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20260612165718.433546-5-andrey.drobyshev@virtuozzo.com> On Fri, Jun 12, 2026 at 07:57:18PM +0300, Andrey Drobyshev wrote: >During QEMU CPR live-update (and VHOST_RESET_OWNER in general) the guest >keeps running while the host drops and later re-attaches vhost backends. >If the guest adds a buffer to the TX virtqueue (guest->host) and kicks >while the backend is temporarily NULL (between vhost_vsock_drop_backends() >and the next vhost_vsock_start()), then the kick is delivered to the >vhost worker, handle_tx_kick() sees a NULL backend and returns, and the >kick signal is consumed. The buffer is then left in the ring. > >Then upon device start vhost_vsock_start() only re-kicks the RX send >worker, never the TX VQ, so the buffer is processed only if the guest >happens to kick again. But if the guest itself is now waiting for data >from the host, it will never kick TX VQ again, and we end up in a >deadlock. > >The deadlock is reproduced during active host->guest socat data transfer >under multiple consecutive CPR live-update's. > >To fix this, in vhost_vsock_start(), after kicking the RX send worker, also >queue the TX vq poll so any buffers the guest enqueued while we were paused >get scanned. Again, it seems like we're fixing an issue that existed before this series, but IIUC without support for VHOST_RESET_OWNER, this could never have happened, so the wording should be changed to make it clear that this is can happen only with the new VHOST_RESET_OWNER support. In addition, this patch must also be applied before the VHOST_RESET_OWNER support or merged into it. > >Signed-off-by: Andrey Drobyshev >--- > drivers/vhost/vsock.c | 6 ++++++ > 1 file changed, 6 insertions(+) > >diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c >index bcaba36becd7..1fcfe71d18be 100644 >--- a/drivers/vhost/vsock.c >+++ b/drivers/vhost/vsock.c >@@ -655,6 +655,12 @@ static int vhost_vsock_start(struct vhost_vsock *vsock) > */ > vhost_vq_work_queue(&vsock->vqs[VSOCK_VQ_RX], &vsock->send_pkt_work); > >+ /* >+ * Some packets might've also been queued in TX VQ. Re-scan it here, >+ * mirroring the RX send-worker kick above. >+ */ Can we also mention that this is related to VHOST_RESET_OWNER? Thanks, Stefano >+ vhost_poll_queue(&vsock->vqs[VSOCK_VQ_TX].poll); >+ > mutex_unlock(&vsock->dev.mutex); > return 0; > >-- >2.47.1 >