From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11A0BC0650E for ; Mon, 1 Jul 2019 15:08:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D51EC20659 for ; Mon, 1 Jul 2019 15:08:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JXWwK7v6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730034AbfGAPIi (ORCPT ); Mon, 1 Jul 2019 11:08:38 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:43469 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727568AbfGAPIi (ORCPT ); Mon, 1 Jul 2019 11:08:38 -0400 Received: by mail-wr1-f65.google.com with SMTP id p13so14240467wru.10; Mon, 01 Jul 2019 08:08:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=LrbpjkQWerlunh+jeg3XioAotSIW/UwN3t21/vc60iI=; b=JXWwK7v6XEcs0OcGV8++JG1skKr/kr821hTyDG9c7CSJo5gWT5oFllmVtyWXK8FXFj yf3FfYlSQ51/rEml0Fzx/WmfBKNx3Ut/mbSvITyYvbM5pY6iEdE0BcBprLybJ3hA/LZg qiDdj3fOXQiNGT43YPcVPWeL21JoKL7VMRST43yF93hIzxie87lb5+8UwQY+jmXfU3hY TUJG19mgj3lF5yWOZI77MANVBqYIdwTwAgO6rE0cGt7Y6oqOsVIvH3lbvanjfv3QRBaX u1nhRbZusAzjFGsfNgQuqJe3bWWz+jk6sK6u5c0ZiYhy/2FdHPN0AFOL8ulY5sEBgieX Ae1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=LrbpjkQWerlunh+jeg3XioAotSIW/UwN3t21/vc60iI=; b=Nvu0DLmAPCrNZwdbCYTQe7CgIB9PFLyRu4oRNAWY620rLwqbwHUbvYngtl9MsEzIwf 02NaAfvjuv6xOBTqnYY7t9qlZcuOMaLNgPIQcvKh31LfVJLFELR3649POzmAs3DApIwM ok+CGx0V0wfvNy8yik1zhbYAZB04lBE4gEC3HPJbIMgFRLA+wIpiZFM3+//2bKoFs748 vXMJeOdhZVPl7ZP10ugptsrqShMVprg5IdDVkOUMZDHxC1YAelzVKKdEaQ2wMuh7+LF9 hYRiqHNwp7o0FiV4wRoU7Foyme2Mm6QwQvdT+r6r9u+n2/45fMo/A7WHYsdto7tFDNLE SQdQ== X-Gm-Message-State: APjAAAU20wqYBFkGe2ulgBEvVbt/dkx2ZYeJKgDoM0SexgEeIuepdCPO WVqHfwaR77hgJ7BxTzctwPk= X-Google-Smtp-Source: APXvYqzZdW0/Y4hmwKKDz/2X7Q0VwEU4tO5q2PLye3hB7/1KoFP9nEEiTBMs9FfvVZZ33rZ/AahFwA== X-Received: by 2002:a5d:4992:: with SMTP id r18mr19297196wrq.107.1561993716303; Mon, 01 Jul 2019 08:08:36 -0700 (PDT) Received: from localhost ([51.15.41.238]) by smtp.gmail.com with ESMTPSA id n125sm15427370wmf.6.2019.07.01.08.08.35 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 01 Jul 2019 08:08:35 -0700 (PDT) Date: Mon, 1 Jul 2019 16:08:34 +0100 From: Stefan Hajnoczi To: Stefano Garzarella Cc: netdev@vger.kernel.org, kvm@vger.kernel.org, "Michael S. Tsirkin" , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Stefan Hajnoczi , "David S. Miller" Subject: Re: [PATCH v2 3/3] vsock/virtio: fix flush of works during the .remove() Message-ID: <20190701150834.GB11900@stefanha-x1.localdomain> References: <20190628123659.139576-1-sgarzare@redhat.com> <20190628123659.139576-4-sgarzare@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0eh6TmSyL6TZE2Uz" Content-Disposition: inline In-Reply-To: <20190628123659.139576-4-sgarzare@redhat.com> User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --0eh6TmSyL6TZE2Uz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 28, 2019 at 02:36:59PM +0200, Stefano Garzarella wrote: > This patch moves the flush of works after vdev->config->del_vqs(vdev), > because we need to be sure that no workers run before to free the > 'vsock' object. >=20 > Since we stopped the workers using the [tx|rx|event]_run flags, > we are sure no one is accessing the device while we are calling > vdev->config->reset(vdev), so we can safely move the workers' flush. What about send_pkt and loopback work? How were they stopped safely? For example, if send_pkt work executes then we're in trouble since it accesses the tx virtqueue which is deleted by ->del_vqs(). --0eh6TmSyL6TZE2Uz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAl0aIfIACgkQnKSrs4Gr c8iHxwf/f/ztZPmFyV30cfT2/l/WmLT+ofdX6M4X2Z7eEb3qolhp0sYuGZjAXdAP FrEZY0n5LGLBskjM4s3HThB2uyV/ByLZPDBKuA7SszFKZWGbB/VgR7Z2BzDCaaz2 7HnJPZoeE7KzeCygCEQ7dneriR+/HgqEW6VZFlaOYX31Nv4X7hUYerrqwmcP9qS+ tMXxWcsEMjZi9bQFxr+MCZqEJoK/Xct0Yt0ssNUxNz6Uv/KAG7XIaRXP/f+GjHXy Uyw/MJKpC4T3N+YwpR9xfGWvLK7NZqvuorr4JGqB8R49AODaYBJepjdxnd6OD8bY qmeew3QFothoW6phvjI3A4uKJVsYvw== =KE3u -----END PGP SIGNATURE----- --0eh6TmSyL6TZE2Uz-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Hajnoczi Subject: Re: [PATCH v2 3/3] vsock/virtio: fix flush of works during the .remove() Date: Mon, 1 Jul 2019 16:08:34 +0100 Message-ID: <20190701150834.GB11900@stefanha-x1.localdomain> References: <20190628123659.139576-1-sgarzare@redhat.com> <20190628123659.139576-4-sgarzare@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5623369206675976036==" Return-path: In-Reply-To: <20190628123659.139576-4-sgarzare@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Stefano Garzarella Cc: kvm@vger.kernel.org, "Michael S. Tsirkin" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Stefan Hajnoczi , "David S. Miller" List-Id: virtualization@lists.linuxfoundation.org --===============5623369206675976036== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0eh6TmSyL6TZE2Uz" Content-Disposition: inline --0eh6TmSyL6TZE2Uz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 28, 2019 at 02:36:59PM +0200, Stefano Garzarella wrote: > This patch moves the flush of works after vdev->config->del_vqs(vdev), > because we need to be sure that no workers run before to free the > 'vsock' object. >=20 > Since we stopped the workers using the [tx|rx|event]_run flags, > we are sure no one is accessing the device while we are calling > vdev->config->reset(vdev), so we can safely move the workers' flush. What about send_pkt and loopback work? How were they stopped safely? For example, if send_pkt work executes then we're in trouble since it accesses the tx virtqueue which is deleted by ->del_vqs(). --0eh6TmSyL6TZE2Uz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAl0aIfIACgkQnKSrs4Gr c8iHxwf/f/ztZPmFyV30cfT2/l/WmLT+ofdX6M4X2Z7eEb3qolhp0sYuGZjAXdAP FrEZY0n5LGLBskjM4s3HThB2uyV/ByLZPDBKuA7SszFKZWGbB/VgR7Z2BzDCaaz2 7HnJPZoeE7KzeCygCEQ7dneriR+/HgqEW6VZFlaOYX31Nv4X7hUYerrqwmcP9qS+ tMXxWcsEMjZi9bQFxr+MCZqEJoK/Xct0Yt0ssNUxNz6Uv/KAG7XIaRXP/f+GjHXy Uyw/MJKpC4T3N+YwpR9xfGWvLK7NZqvuorr4JGqB8R49AODaYBJepjdxnd6OD8bY qmeew3QFothoW6phvjI3A4uKJVsYvw== =KE3u -----END PGP SIGNATURE----- --0eh6TmSyL6TZE2Uz-- --===============5623369206675976036== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization --===============5623369206675976036==--