Received: by 10.192.165.148 with SMTP id m20csp2103242imm; Thu, 26 Apr 2018 06:17:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx49yFz2NptzhzAsjMs3psV5Jwv/uZFnvhjrni7HhWoUoiZPMSJ58/uAabTd+rbXuzjCLj1FM X-Received: by 10.99.141.202 with SMTP id z193mr27417377pgd.418.1524748625147; Thu, 26 Apr 2018 06:17:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524748625; cv=none; d=google.com; s=arc-20160816; b=ou3nb80p4VlvrKoofpjmMycYb69EWcYTGgFFwNbmQfGEBo6Qw9MU7C8tg1KcTvrsVn nrL0npy0yKeehC709yoZHc0Cpo3In0PtJ3GhveYQlRf7rmSO2PwtXND+tvRu2Mlvvf0y DBA2Cf7SgXfj6ACLccz5aNDkmHcOWX+v5+RcoVZ63O8PTz7MaRkhrqJdy5r1YW2G6Llo q29HJiljMhucaVa0S3Qoh0LIYaWTxgi00qr/AmUSktO17firUFUkRQ6M7fjkPTXQcIXT RWKMhd8QJhkhMU2+tp1pf6IsDiZ2f2aGyn/h/RP5dzpcgHnhDR0VDiijZAtiSKJwr0Xx pq6w== 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:arc-authentication-results; bh=2Tuc5dkKbJ2eKo5fmN1gSFhEa+n8YJOGgBScRWmtb9I=; b=pVbbFPzwMFYujAq0irc8qTxuKuMgmSVW+yDRpAXh294aUmh8lUHvjqKg1D0Tyyatig qnQUZq+QfkO0zAXsZyXsy6o+SANYcsQl0wjaRC2hL/epD146Qv4SFTVbrMbqVjW/L6Rk YxROD14o3sFb08G7a1cmxCMZItKCIVu/jcp6++kqo3xMNVXUoQcu0yJ3KYGphHolPq2n KHZplMnoeLxYRm5TYtSjsrTas62Sh7diaVPmOIqcpYpryKOYfrOJRkeTRQfEsoCn7pA0 wf3UamRiaZxy6VZaGUt5tfssujnGGv/CMygPbzyQJa9QBAhqfS0KDwZPxM8m29VIxUvM OGeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eY/WCE6N; 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 8-v6si18668109plc.342.2018.04.26.06.16.40; Thu, 26 Apr 2018 06:17:05 -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=eY/WCE6N; 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 S1756204AbeDZNPX (ORCPT + 99 others); Thu, 26 Apr 2018 09:15:23 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:52366 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754516AbeDZNPU (ORCPT ); Thu, 26 Apr 2018 09:15:20 -0400 Received: by mail-wm0-f65.google.com with SMTP id w195so12904245wmw.2; Thu, 26 Apr 2018 06:15:19 -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=2Tuc5dkKbJ2eKo5fmN1gSFhEa+n8YJOGgBScRWmtb9I=; b=eY/WCE6NxPGVD3+6oFucqqTzxPCiGXipL+SHuApsq5dSC0d9XAARsJE5zhZs6hVS5W j9hNlgi6RhQByI2tB1Zn7pA5xumAGMNTSTCE2TOsI9PNC/aWwKu8BAJvv4hUIra7C/rb lxcRA6AD2S6TiOazJPr0BfTLwgAdeHgQq8+pSr68Q2GdPIWx9Dtx/cCtZ04ZN5kg+sLp cqIRbrb5aZ3L2C2qmyd6q3UpR4IUDOUTNu2J4+TLv2Zb7fhWs12mH5ihRtG1VvBy5QYO bkT25MVtmIRM9pKGIhPlC063YUK90wAstTi/AWFQbggefPinuOo1H+sOtpqyqyWlm/fI IJ3g== 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=2Tuc5dkKbJ2eKo5fmN1gSFhEa+n8YJOGgBScRWmtb9I=; b=PmvrwZnGTgxRWmUnc05Edc/13SA9T3aZyCk64/3PmXR0srTcR6fhvT+TP2CsFCehk9 8lSly5UdVBimCCrri/fNX6PDGqk6lRqeq1oL21+slfql46pkzOtfVmfsTXsBHMgzKVil rSHr1SIySegvFHHKsmrYJlqUK7qktE8rYuW+DCryFzImJvIfZ3NQFU1F9qJZum39p+p7 150RjosiA2xZ71igPrhCfjStzZYIhjCF8AjckY+mmYfjjfZEcsWbfy19EVR/rNGM8YAO sn48C+geUph70E80CUDDdoQW+NFppWru2UxEgLmToPMkRjEJKOnR7pvbjUj4FHa9x36h MN9Q== X-Gm-Message-State: ALQs6tD1UIZeQXRJypFLk04k1K/VaM7e7UfSyFbsssihbJnXnPjAyjcz KG0n60jTI+yJ6OvOT0Lsemk= X-Received: by 10.28.217.211 with SMTP id q202mr8627754wmg.84.1524748518739; Thu, 26 Apr 2018 06:15:18 -0700 (PDT) Received: from localhost ([51.15.41.238]) by smtp.gmail.com with ESMTPSA id l15-v6sm18909453wrb.85.2018.04.26.06.15.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Apr 2018 06:15:17 -0700 (PDT) Date: Thu, 26 Apr 2018 14:15:17 +0100 From: Stefan Hajnoczi To: Pankaj Gupta Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, qemu-devel@nongnu.org, linux-nvdimm@ml01.01.org, linux-mm@kvack.org, jack@suse.cz, stefanha@redhat.com, dan.j.williams@intel.com, riel@surriel.com, haozhong.zhang@intel.com, nilal@redhat.com, kwolf@redhat.com, pbonzini@redhat.com, ross.zwisler@intel.com, david@redhat.com, xiaoguangrong.eric@gmail.com, hch@infradead.org, marcel@redhat.com, mst@redhat.com, niteshnarayanlal@hotmail.com, imammedo@redhat.com, lcapitulino@redhat.com Subject: Re: [RFC v2 2/2] pmem: device flush over VIRTIO Message-ID: <20180426131517.GB30991@stefanha-x1.localdomain> References: <20180425112415.12327-1-pagupta@redhat.com> <20180425112415.12327-3-pagupta@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NDin8bjvE/0mNLFQ" Content-Disposition: inline In-Reply-To: <20180425112415.12327-3-pagupta@redhat.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --NDin8bjvE/0mNLFQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 25, 2018 at 04:54:14PM +0530, Pankaj Gupta wrote: > This patch adds functionality to perform=20 > flush from guest to hosy over VIRTIO=20 > when 'ND_REGION_VIRTIO'flag is set on=20 > nd_negion. Flag is set by 'virtio-pmem' > driver. >=20 > Signed-off-by: Pankaj Gupta > --- > drivers/nvdimm/region_devs.c | 7 +++++++ > 1 file changed, 7 insertions(+) >=20 > diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c > index a612be6..6c6454e 100644 > --- a/drivers/nvdimm/region_devs.c > +++ b/drivers/nvdimm/region_devs.c > @@ -20,6 +20,7 @@ > #include > #include "nd-core.h" > #include "nd.h" > +#include > =20 > /* > * For readq() and writeq() on 32-bit builds, the hi-lo, lo-hi order is > @@ -1074,6 +1075,12 @@ void nvdimm_flush(struct nd_region *nd_region) > struct nd_region_data *ndrd =3D dev_get_drvdata(&nd_region->dev); > int i, idx; > =20 > + /* call PV device flush */ > + if (test_bit(ND_REGION_VIRTIO, &nd_region->flags)) { > + virtio_pmem_flush(&nd_region->dev); > + return; > + } How does libnvdimm know when flush has completed? Callers expect the flush to be finished when nvdimm_flush() returns but the virtio driver has only queued the request, it hasn't waited for completion! --NDin8bjvE/0mNLFQ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJa4dDlAAoJEJykq7OBq3PI980IAJY41FLfXhqcQzxR13OvtKqj cM7mQMJIee6fETlh9HYqEh7dOvOHhpqojY9PEKA+Bu1f/KC3Y03liilCCKdLiHc+ WpCVSyT3nOTjPlY4tS+e4WEEzaCwqNYu8rbz7sfJxd1c+4Hl9VuLfBQLieSnTsmE GUawKQak2e+c7EdOdKxmxtaeZfX1qJcm6ZMhbqSrvIrzR+E+fz4WKmntxrdgeDwY 4IzZHK5h2u4z0jSeLf0tfdWf/77y1IWPqKGvuK6MTZHFxvMn6AiI4VZ116LfXgNC l7SS25ehqJ5WGgBrUYsL40QAimQDSCQL2ouNwyx/Q1+Ub/xi6TWKN17u3UV5Bpc= =i3H2 -----END PGP SIGNATURE----- --NDin8bjvE/0mNLFQ--