[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPcyv4gpZzKfE7jY1peYOVd6sVhNz7jce1s_xNH_2Lt8AjRK-Q@mail.gmail.com>
Date: Wed, 25 Apr 2018 07:23:53 -0700
From: Dan Williams <dan.j.williams@...el.com>
To: Pankaj Gupta <pagupta@...hat.com>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
KVM list <kvm@...r.kernel.org>,
Qemu Developers <qemu-devel@...gnu.org>,
linux-nvdimm <linux-nvdimm@...1.01.org>,
Linux MM <linux-mm@...ck.org>, Jan Kara <jack@...e.cz>,
Stefan Hajnoczi <stefanha@...hat.com>,
Rik van Riel <riel@...riel.com>,
Haozhong Zhang <haozhong.zhang@...el.com>,
Nitesh Narayan Lal <nilal@...hat.com>,
Kevin Wolf <kwolf@...hat.com>,
Paolo Bonzini <pbonzini@...hat.com>,
"Zwisler, Ross" <ross.zwisler@...el.com>,
David Hildenbrand <david@...hat.com>,
Xiao Guangrong <xiaoguangrong.eric@...il.com>,
Christoph Hellwig <hch@...radead.org>,
Marcel Apfelbaum <marcel@...hat.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
niteshnarayanlal@...mail.com, Igor Mammedov <imammedo@...hat.com>,
lcapitulino@...hat.com
Subject: Re: [RFC v2 2/2] pmem: device flush over VIRTIO
On Wed, Apr 25, 2018 at 4:24 AM, Pankaj Gupta <pagupta@...hat.com> wrote:
> This patch adds functionality to perform
> flush from guest to hosy over VIRTIO
> when 'ND_REGION_VIRTIO'flag is set on
> nd_negion. Flag is set by 'virtio-pmem'
> driver.
>
> Signed-off-by: Pankaj Gupta <pagupta@...hat.com>
> ---
> drivers/nvdimm/region_devs.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> 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 <linux/nd.h>
> #include "nd-core.h"
> #include "nd.h"
> +#include <linux/virtio_pmem.h>
>
> /*
> * 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 = dev_get_drvdata(&nd_region->dev);
> int i, idx;
>
> + /* call PV device flush */
> + if (test_bit(ND_REGION_VIRTIO, &nd_region->flags)) {
> + virtio_pmem_flush(&nd_region->dev);
> + return;
> + }
> +
I'd rather introduce a ->flush() operation hanging off of 'struct
nd_region' so that this multiplexing can be a static setting.
Powered by blists - more mailing lists