Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2819894lqo; Mon, 20 May 2024 19:29:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVjX/3GRgFTIxOS/dGZzuKqFLf5sVYXxoHamS7AHqbA6jvZI6hIFCu1A+CnDpUPblSFQqwrNHGZs7aGAnuN4MUvHr9zg1S2jruK6vTtLA== X-Google-Smtp-Source: AGHT+IHTnwdzFTfE+tyHEvhkYgMYlPBRdHb9tUEVmzYeZVfPHlvNdZAtvW/yO0gIk5sBDIgOLuSB X-Received: by 2002:a05:620a:e0f:b0:78d:766a:d695 with SMTP id af79cd13be357-792c760392fmr3108834185a.77.1716258563504; Mon, 20 May 2024 19:29:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716258563; cv=pass; d=google.com; s=arc-20160816; b=Ys+tWicLWuQIR6pAJUsPoNH8s8gmZVNGYQIwJ+qASetlAXT1lwzmIv3oIY2T/6+M7T r93fipWuzxQkEaq5vwd/hwncc13NgXU/j0ilzzTM5yQMXNrLMUIFPTEpxASb5jWYxJ3P LBRlBiaol3zDD9gU0EHXaGZO5Z6nnHMPe8Dv40CiJddQS5GJPmX3eb3czQHtFkT2Umb5 e2g8zvToliRdoQrK+GqpOUeq34gCghM4nPP6IVxyJlfqotdRxSLsemifbAeg4tizRYQo WLvaiwhx5WM1LLna7BcgvrwWy7/hj4jrRreAkYh0vZRUxmOk74c+h6F0CXDl9K2npmua QX8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=w/SMSLTAXFZZwyaLr5kA0B7cu9hCGbcKtCcSYK2/MZg=; fh=eRCLRjP34HeSi2KRvFyjAZ/BixvPkie/4V7TU9AwLME=; b=Iyof5WOVXRSDDDaOzeRgu/W2AKka5I8I1c2CgVsYEmxzhUDI6fNK1OXPuL/SxixYv0 CJOM+e0dLhP2ikMirMcoEu44/dssaA67GEXXaE+CSg+C+eAql+vamlLZBjcVUwlKEbHo /cai8UiGj+7DP76rqAlQpnxvIufjc6pED5tbesi57uNrymHtozACOzSebvX+Pn4FvlG2 JdgREoAAwD2wylyf8diOURy5UDTYqY2X5X1BtrPpKyak4FPtnKMB3AL4IGfwmNP4Gm/B wxDT7KfsnsM9O6AlLj4qPabQdqkFZMVw8mgZD1YJVvLS/W+aWhseOC793+aWeg/3YzNp 0N+A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U6UMxeLq; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-184365-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184365-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-792bf30abf2si54973085a.374.2024.05.20.19.29.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 19:29:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184365-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U6UMxeLq; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-184365-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184365-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 346CD1C20FB7 for ; Tue, 21 May 2024 02:29:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E9F93134AC; Tue, 21 May 2024 02:29:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="U6UMxeLq" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 75212134A9 for ; Tue, 21 May 2024 02:29:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716258555; cv=none; b=aM7e/PwapK1UPDszA5qSq/1n3Elo7zCawu4GAHGuYM+73JS7O/xpHfiW3CiZeOjY7xRtd++QmzKvQzuRSV4TrPTu9GtQY87RkWS13qBpgc1mVcAVogW38OFIQMWcg7dTXD4/Sy9rDhLqQHw3ceK5QOnz/ztb6sdodb+w2XWQCPo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716258555; c=relaxed/simple; bh=fHuz2izoRrXrdHAlUrSjhQX2YUje7YUBi+uJY+FIFow=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=rMxTmviRZbTSYHEophSSMhYvweRaTVEkXYgp9/IKVdhCjfB+FWS3tDgAaHU7wJP+yyDHgq9G5o5JTa/VN4GN0mPDlv5JCDnf3CZEvLGNKbA1o2voIhOcR6tPRBEkBrKKY56IPn0SU6j1KDqgd6nm/9QffjHQvl1wxveiFyxN5a0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=U6UMxeLq; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716258552; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w/SMSLTAXFZZwyaLr5kA0B7cu9hCGbcKtCcSYK2/MZg=; b=U6UMxeLqj/g244r0zOY7+I7RFOf2HAzZTcrIOhanm5KzQLnEI+LHkpu1yIdnJFgkKszaim lNnbGb2CG7XRuK0+3f3Alcl/BK/V2yhZ44Xm1SotweippXOs9OFwZX2Cml+x1MsOaBYDSM Vd/59X2MS4DoSZvcFE9rTD9gKiGHtys= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-368-8DZktjcVMpWbsHmFAzGJOA-1; Mon, 20 May 2024 22:29:10 -0400 X-MC-Unique: 8DZktjcVMpWbsHmFAzGJOA-1 Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-2b4330e57b6so12201921a91.2 for ; Mon, 20 May 2024 19:29:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716258549; x=1716863349; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w/SMSLTAXFZZwyaLr5kA0B7cu9hCGbcKtCcSYK2/MZg=; b=YBZ/JlYDvk/LiRuuJPmabTz5bsxUl2tmYo9gNh9L1R8ahceIM9eLQWZcBrwG/U3AuJ kG2mlAnNJL+1/oPAN4MyzEW3FNl/Wj8Mf+HCzV/5S/G36JCJMHwDEtXUMIduDWMPWnLk SvdgBLoKkHiBdkM1hj7UfJddgh9v4ePes9LMUPvQ2Nv5rX3c8CNJ/UE+1RJJePxRIaoq SbpgMsp1ZcJ7W+GMwbOCGslT4LVrlOt6qvqmcPD0i3MkC3dk/wuAnNuDngsoQ189wgTe WsGSidl5DBpiZyrP8r+xCQIjpmM6/6UIHr+XRyxdtREwuIX7XvZSgTWPX9Q1fMQeNQeJ fOlg== X-Forwarded-Encrypted: i=1; AJvYcCWGBV/LSLmCe5GAGvJCThS8CSR9PaDdJMqkKM1JVMyIblTNYtPAbynJONqabCxGZwCUsCgfAsZgo3JB2Yo/cVBeXgj8O5KIfq+q4Owv X-Gm-Message-State: AOJu0YwadAf5t8kJDAjzBcISdv9DHi4VafZF8LbzK+N/+Aesy71s4y7w KRxDMdqMSTT99P0/iEt2LLjn+g2awxETWjCE6hjI44qtZ2z7qVnNv8lT9V56sVRji1sMU3mpXPY pfOXTIJGwAypZoYYiG/OOhuOHoj/Ldn0k9WlXpk8iAlv7LBlB2Zbiep94/faAkTCtOMNaBgdLXF FZHfTNt5pN+f7SdquD78si1KTjJ5lXw+6PYQ+o X-Received: by 2002:a17:90a:590e:b0:2bd:9319:3da1 with SMTP id 98e67ed59e1d1-2bd93193deemr634200a91.25.1716258549715; Mon, 20 May 2024 19:29:09 -0700 (PDT) X-Received: by 2002:a17:90a:590e:b0:2bd:9319:3da1 with SMTP id 98e67ed59e1d1-2bd93193deemr634190a91.25.1716258549414; Mon, 20 May 2024 19:29:09 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <1716218462-84587-1-git-send-email-steven.sistare@oracle.com> <1716218462-84587-2-git-send-email-steven.sistare@oracle.com> In-Reply-To: <1716218462-84587-2-git-send-email-steven.sistare@oracle.com> From: Jason Wang Date: Tue, 21 May 2024 10:28:57 +0800 Message-ID: Subject: Re: [PATCH V3 1/3] vhost-vdpa: flush workers on suspend To: Steve Sistare Cc: virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, "Michael S. Tsirkin" , Si-Wei Liu , Eugenio Perez Martin , Xie Yongji , Stefano Garzarella Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, May 20, 2024 at 11:21=E2=80=AFPM Steve Sistare wrote: > > Flush to guarantee no workers are running when suspend returns. > > Fixes: f345a0143b4d ("vhost-vdpa: uAPI to suspend the device") > Signed-off-by: Steve Sistare > Acked-by: Eugenio P=C3=A9rez > --- > drivers/vhost/vdpa.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c > index ba52d128aeb7..189596caaec9 100644 > --- a/drivers/vhost/vdpa.c > +++ b/drivers/vhost/vdpa.c > @@ -594,6 +594,7 @@ static long vhost_vdpa_suspend(struct vhost_vdpa *v) > struct vdpa_device *vdpa =3D v->vdpa; > const struct vdpa_config_ops *ops =3D vdpa->config; > int ret; > + struct vhost_dev *vdev =3D &v->vdev; > > if (!(ops->get_status(vdpa) & VIRTIO_CONFIG_S_DRIVER_OK)) > return 0; > @@ -601,6 +602,8 @@ static long vhost_vdpa_suspend(struct vhost_vdpa *v) > if (!ops->suspend) > return -EOPNOTSUPP; > > + vhost_dev_flush(vdev); vhost-vDPA doesn't use workers, see: vhost_dev_init(dev, vqs, nvqs, 0, 0, 0, false, vhost_vdpa_process_iotlb_msg); So I wonder if this is a must. Thanks > + > ret =3D ops->suspend(vdpa); > if (!ret) > v->suspended =3D true; > -- > 2.39.3 >