Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2247212ybi; Mon, 1 Jul 2019 08:41:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtnij+wOB1AUE4mdwFg/+ZTwNea5oRfPg+hv/0XO6LSb/BUCyTz/064EsHVyOgwwLyle80 X-Received: by 2002:a17:902:b591:: with SMTP id a17mr28781927pls.96.1561995691708; Mon, 01 Jul 2019 08:41:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561995691; cv=none; d=google.com; s=arc-20160816; b=ASBAQOP2rUu0d3a6PqVZt+WT7bBCT3UeQbL84FnuloufmHjC0SxDl73YkMG7ym+eat XTwx8toFVlsSHmq6g02L58KlZ7Q6mTXOUhOjRXIx7mm3Xk6eB9QgmBzffSJXOs9bdFjA L1pF2ttycXKR0UF5NfqQbGOi2zFsdi6CLJop+bvzffaMiplWTsEiefLcEsKaPwDEAxB7 1WYmshiveovWOIGrJ276/BeP9Qg8MsEdaFEOt0qWLQ7RSDJFksio5GbE+ZV/jaTuvn/t 5kPf4LWtQRAKEYQHHkjzOdijOo9COjye/qQlrdggYYQV2GMVccIWGVhzcIAE62kAYKFW qETw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=LrbpjkQWerlunh+jeg3XioAotSIW/UwN3t21/vc60iI=; b=xLKdUA6x4ex0RZSCL9Y0oKNPVOyDU20ZdyEVdLHSu7jZ8LhtvQ7Sh36rf96N8sJNpz c+2IrU3g168Kvh7/lDX3lrWYZLOocG+rQyjFEyepqCf62lusR9NYwKKqngLzsseeqIvc pj21N2ViEY//IzOdZZp8LrvYx57W3vz/9fiGNvDhqMfJv3CWG2GMa4Nk3tXanjvstPJI cHABTj9tMEy9MoDOpzr13nfVhca225OTwM2Bk1cPidywz1k12e3mroAfOSA/K6QwjApO NlY499zYF0Eq45CXQKPHoefsAWJUcJR22NOfXjcT7fT/JlgQpxgOXr2Z2ht8bqNRYoyj gKzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JXWwK7v6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x21si10741231pln.192.2019.07.01.08.41.15; Mon, 01 Jul 2019 08:41:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JXWwK7v6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728679AbfGAPIi (ORCPT + 99 others); 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-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--