Re: [PATCH RFC 3/6] KVM: x86: interrupt based APF page-ready event delivery

2020-05-05 Thread Vivek Goyal
On Wed, Apr 29, 2020 at 11:36:31AM +0200, Vitaly Kuznetsov wrote: > Concerns were expressed around APF delivery via synthetic #PF exception as > in some cases such delivery may collide with real page fault. For type 2 > (page ready) notifications we can easily switch to using an interrupt >

Re: [PATCH RFC 1/6] Revert "KVM: async_pf: Fix #DF due to inject "Page not Present" and "Page Ready" exceptions simultaneously"

2020-05-05 Thread Vivek Goyal
On Wed, Apr 29, 2020 at 11:36:29AM +0200, Vitaly Kuznetsov wrote: > Commit 9a6e7c39810e (""KVM: async_pf: Fix #DF due to inject "Page not > Present" and "Page Ready" exceptions simultaneously") added a protection > against 'page ready' notification coming before 'page not ready' is > delivered.

Re: [PATCH v5 0/4] virtio-fs: shared file system for virtual machines

2019-09-11 Thread Vivek Goyal
On Tue, Sep 10, 2019 at 05:12:02PM +0200, Miklos Szeredi wrote: > Git tree for this version is available here: > > git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git#virtiofs-v5 > > Only post patches that actually add virtiofs (virtiofs-v5-base..virtiofs-v5). > > I've folded the

Re: [Virtio-fs] [PATCH 15/18] virtiofs: Make virtio_fs object refcounted

2019-09-09 Thread Vivek Goyal
On Sun, Sep 08, 2019 at 07:10:03PM +0800, piaojun wrote: > > > On 2019/9/6 3:48, Vivek Goyal wrote: > > This object is used both by fuse_connection as well virt device. So make > > this object reference counted and that makes it easy to define life cycle > > of the

Re: [PATCH 08/18] virtiofs: Drain all pending requests during ->remove time

2019-09-06 Thread Vivek Goyal
On Fri, Sep 06, 2019 at 11:52:10AM +0100, Stefan Hajnoczi wrote: > On Thu, Sep 05, 2019 at 03:48:49PM -0400, Vivek Goyal wrote: > > +static void virtio_fs_drain_queue(struct virtio_fs_vq *fsvq) > > +{ > > + WARN_ON(fsvq->in_flight < 0); > > + > > + /

Re: [PATCH 16/18] virtiofs: Use virtio_fs_mutex for races w.r.t ->remove and mount path

2019-09-06 Thread Vivek Goyal
On Fri, Sep 06, 2019 at 01:05:34PM +0100, Stefan Hajnoczi wrote: > On Thu, Sep 05, 2019 at 03:48:57PM -0400, Vivek Goyal wrote: > > It is possible that a mount is in progress and device is being removed at > > the same time. Use virtio_fs_mutex to avoid races. > > >

Re: [PATCH 15/18] virtiofs: Make virtio_fs object refcounted

2019-09-06 Thread Vivek Goyal
On Fri, Sep 06, 2019 at 01:03:09PM +0100, Stefan Hajnoczi wrote: > On Thu, Sep 05, 2019 at 03:48:56PM -0400, Vivek Goyal wrote: > > This object is used both by fuse_connection as well virt device. So make > > this object reference counted and that makes it easy to de

Re: [PATCH 14/18] virtiofs: Add a fuse_iqueue operation to put() reference

2019-09-06 Thread Vivek Goyal
On Fri, Sep 06, 2019 at 01:00:09PM +0100, Stefan Hajnoczi wrote: > On Thu, Sep 05, 2019 at 03:48:55PM -0400, Vivek Goyal wrote: > > diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h > > index 85e2dcad68c1..04e2c000d63f 100644 > > --- a/fs/fuse/fuse_i.h > > +++ b/fs/

Re: [PATCH 00/18] virtiofs: Fix various races and cleanups round 1

2019-09-06 Thread Vivek Goyal
On Fri, Sep 06, 2019 at 01:52:41PM +0200, Miklos Szeredi wrote: > On Fri, Sep 6, 2019 at 12:36 PM Stefan Hajnoczi wrote: > > > > On Fri, Sep 06, 2019 at 10:15:14AM +0200, Miklos Szeredi wrote: > > > On Thu, Sep 5, 2019 at 9:49 PM Vivek Goyal wrote: > > > >

[PATCH 15/18] virtiofs: Make virtio_fs object refcounted

2019-09-05 Thread Vivek Goyal
be around and will be cleaned when filesystem is unmounted and sb/fc drops its reference. Removing a device also stops all virt queues and any new reuqest gets error -ENOTCONN. All existing in flight requests are drained before ->remove returns. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c |

[PATCH 02/18] virtiofs: Check whether hiprio queue is connected at submission time

2019-09-05 Thread Vivek Goyal
failed. Check this state even in the path when request is being submitted first time. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index a708ccb65662..e9497b565dd8 100644

[PATCH 04/18] virtiofs: Check connected state for VQ_REQUEST queue as well

2019-09-05 Thread Vivek Goyal
mitted anymore and user space will see error -ENOTCONN. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index 9d30530e3ca9..c46dd4d284d6 100644 --- a/fs/fuse/virtio_fs.c +++ b/fs/fuse/virti

[PATCH 11/18] virtiofs: stop and drain queues after sending DESTROY

2019-09-05 Thread Vivek Goyal
flush_work() on various workers, remove this logic from virtio_free_devs(). Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index 1ea0f889e804..a76bd5a04521 100644 --- a/fs

[PATCH 00/18] virtiofs: Fix various races and cleanups round 1

2019-09-05 Thread Vivek Goyal
are fine with the patches, I am fine if you fold these all into existing patch. I kept them separate so that review is easier. Any feedback or comments are welcome. Thanks Vivek Vivek Goyal (18): virtiofs: Remove request from processing list before calling end virtiofs: Check whether hiprio

[PATCH 17/18] virtiofs: Remove TODO to quiesce/end_requests

2019-09-05 Thread Vivek Goyal
We now stop queues and drain all the pending requests from all virtqueues. So this is not a TODO anymore. Got rid of incrementing fc->dev_count as well. It did not seem meaningful for virtio_fs. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 2 -- 1 file changed, 2 deletions(-) d

[PATCH 16/18] virtiofs: Use virtio_fs_mutex for races w.r.t ->remove and mount path

2019-09-05 Thread Vivek Goyal
It is possible that a mount is in progress and device is being removed at the same time. Use virtio_fs_mutex to avoid races. This also takes care of bunch of races and removes some TODO items. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 32 ++-- 1 file

[PATCH 08/18] virtiofs: Drain all pending requests during ->remove time

2019-09-05 Thread Vivek Goyal
When device is going away, drain all pending requests. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 83 - 1 file changed, 51 insertions(+), 32 deletions(-) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index 90e7b2f345e5

[PATCH 05/18] Maintain count of in flight requests for VQ_REQUEST queue

2019-09-05 Thread Vivek Goyal
As of now we maintain this count only for VQ_HIPRIO. Maintain it for VQ_REQUEST as well so that later it can be used to drain VQ_REQUEST queue. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c

[PATCH 01/18] virtiofs: Remove request from processing list before calling end

2019-09-05 Thread Vivek Goyal
In error path we are calling fuse_request_end() but we need to clear FR_SENT bit as well as remove request from processing queue. Otherwise fuse_request_end() triggers a warning as well as other issues show up. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 4 1 file changed, 4

[PATCH 13/18] virtiofs: Do not access virtqueue in request submission path

2019-09-05 Thread Vivek Goyal
In request submission path it is possible that virtqueue is already gone due to driver->remove(). So do not access it in dev_dbg(). Use pr_debug() instead. If virtuqueue is gone, this will result in NULL pointer deference. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 8 1 f

[PATCH 06/18] virtiofs: ->remove should not clean virtiofs fuse devices

2019-09-05 Thread Vivek Goyal
We maintain a fuse device per virt queue. This fuse devices are allocated and installed during mount time and should be cleaned up when super block is going away. Device removal should not clean it. Device removal should stop queues and virtuques can go away. Signed-off-by: Vivek Goyal --- fs

[PATCH 03/18] virtiofs: Pass fsvq instead of vq as parameter to virtio_fs_enqueue_req

2019-09-05 Thread Vivek Goyal
Pass fsvq instead of vq as parameter to virtio_fs_enqueue_req(). We will retrieve vq from fsvq under spin lock. Later in the patch series we will retrieve vq only if fsvq is still connected other vq might have been cleaned up by device ->remove code and we will return error. Signed-off-by: Vi

[PATCH 12/18] virtiofs: Use virtio_fs_free_devs() in error path

2019-09-05 Thread Vivek Goyal
We already have an helper to cleanup fuse devices. Use that instead of duplicating the code. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index a76bd5a04521..40259368a6bd 100644

[PATCH 09/18] virtiofs: Add an helper to start all the queues

2019-09-05 Thread Vivek Goyal
This just marks are the queues are connected and ready to accept the request. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index d5730a50b303..f2936daca39c

[PATCH 10/18] virtiofs: Do not use device managed mem for virtio_fs and virtio_fs_vq

2019-09-05 Thread Vivek Goyal
it at right time. This patch still frees up memory during device remove time. A later patch will make virtio_fs object reference counted and this memory will be freed when last reference to object is dropped. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 13 - 1 file changed, 8

[PATCH 14/18] virtiofs: Add a fuse_iqueue operation to put() reference

2019-09-05 Thread Vivek Goyal
o call into virtio_fs to put the reference on the object (fiq_priv). Signed-off-by: Vivek Goyal --- fs/fuse/fuse_i.h | 5 + fs/fuse/inode.c | 6 ++ 2 files changed, 11 insertions(+) diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 85e2dcad68c1..04e2c000d63f 100644 --- a/fs/fuse/fu

[PATCH 07/18] virtiofs: Stop virtiofs queues when device is being removed

2019-09-05 Thread Vivek Goyal
Stop all the virt queues when device is going away. This will ensure that no new requests are submitted to virtqueue and and request will end with error -ENOTCONN. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/fs/fuse

[PATCH 18/18] virtiofs: Remove TODO item from virtio_fs_free_devs()

2019-09-05 Thread Vivek Goyal
ould be fine as we are not touching vdev or virtqueues. And we have reference on virtio_fs object, so we know rest of the data structures are valid. So I can't see the need of any additional locking yet. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 2 -- 1 file changed, 2 deletions(-) dif

Re: [PATCH v4 15/16] virtio-fs: add virtiofs filesystem

2019-09-05 Thread Vivek Goyal
On Tue, Sep 03, 2019 at 09:55:49AM -0400, Michael S. Tsirkin wrote: [..] > What's with all of the TODOs? Some of these are really scary, > looks like they need to be figured out before this is merged. Hi Michael, One of the issue I noticed is races w.r.t device removal and super block

Re: [PATCH v3 00/13] virtio-fs: shared file system for virtual machines

2019-09-03 Thread Vivek Goyal
On Tue, Sep 03, 2019 at 10:12:16AM -0400, Michael S. Tsirkin wrote: > On Tue, Sep 03, 2019 at 10:07:52AM -0400, Vivek Goyal wrote: > > On Tue, Sep 03, 2019 at 04:31:38AM -0400, Michael S. Tsirkin wrote: > > > > [..] > > > + /* TODO lock */ > > > give me paus

Re: [PATCH v3 00/13] virtio-fs: shared file system for virtual machines

2019-09-03 Thread Vivek Goyal
On Tue, Sep 03, 2019 at 04:31:38AM -0400, Michael S. Tsirkin wrote: [..] > + /* TODO lock */ > give me pause. > > Cleanup generally seems broken to me - what pauses the FS I am looking into device removal aspect of it now. Thinking of adding a reference count to virtiofs device and possibly

Re: [PATCH v3 00/13] virtio-fs: shared file system for virtual machines

2019-08-29 Thread Vivek Goyal
On Thu, Aug 29, 2019 at 11:28:27AM +0200, Miklos Szeredi wrote: [..] > There are miscellaneous changes, so needs to be thoroughly tested. Hi Miklos, First round of tests passed. Ran pjdfstests, blogbench and bunch of fio jobs and everyting looks good. Thanks Vivek

Re: [PATCH v3 00/13] virtio-fs: shared file system for virtual machines

2019-08-29 Thread Vivek Goyal
On Thu, Aug 29, 2019 at 03:41:26PM +0200, Miklos Szeredi wrote: > On Thu, Aug 29, 2019 at 3:29 PM Vivek Goyal wrote: > > > #ifdef CONFIG_VIRTIO_FS > > /** virtio-fs's physically contiguous buffer for in and out args */ > > void *argbuf; > > #endif

Re: [PATCH v3 00/13] virtio-fs: shared file system for virtual machines

2019-08-29 Thread Vivek Goyal
On Thu, Aug 29, 2019 at 11:28:27AM +0200, Miklos Szeredi wrote: > On Wed, Aug 21, 2019 at 7:38 PM Vivek Goyal wrote: > > > > Hi, > > > > Here are the V3 patches for virtio-fs filesystem. This time I have > > broken the patch series in two parts. This is first pa

Re: [PATCH v3 00/13] virtio-fs: shared file system for virtual machines

2019-08-29 Thread Vivek Goyal
On Thu, Aug 29, 2019 at 11:28:27AM +0200, Miklos Szeredi wrote: > On Wed, Aug 21, 2019 at 7:38 PM Vivek Goyal wrote: > > > > Hi, > > > > Here are the V3 patches for virtio-fs filesystem. This time I have > > broken the patch series in two parts. This is first pa

Re: [PATCH 01/19] dax: remove block device dependencies

2019-08-28 Thread Vivek Goyal
On Tue, Aug 27, 2019 at 11:58:09PM -0700, Christoph Hellwig wrote: > On Tue, Aug 27, 2019 at 12:38:28PM -0400, Vivek Goyal wrote: > > > For bdev_dax_pgoff > > > I'd much rather have the partition offset if there is on in the daxdev > > > somehow so that we can get ri

Re: [PATCH 02/13] fuse: Use default_file_splice_read for direct IO

2019-08-28 Thread Vivek Goyal
On Wed, Aug 28, 2019 at 09:45:28AM +0200, Miklos Szeredi wrote: > On Wed, Aug 21, 2019 at 7:38 PM Vivek Goyal wrote: > > > > From: Miklos Szeredi > > Nice patch, except I have no idea why I did this. Splice with > FOPEN_DIRECT_IO seems to work fine without it. I d

Re: [PATCH 01/19] dax: remove block device dependencies

2019-08-27 Thread Vivek Goyal
On Mon, Aug 26, 2019 at 04:51:52AM -0700, Christoph Hellwig wrote: > On Wed, Aug 21, 2019 at 01:57:02PM -0400, Vivek Goyal wrote: > > From: Stefan Hajnoczi > > > > Although struct dax_device itself is not tied to a block device, some > > DAX code assumes there is

Re: [PATCH 05/19] virtio: Implement get_shm_region for MMIO transport

2019-08-27 Thread Vivek Goyal
On Tue, Aug 27, 2019 at 10:39:43AM +0200, Cornelia Huck wrote: > On Wed, 21 Aug 2019 13:57:06 -0400 > Vivek Goyal wrote: > > > From: Sebastien Boeuf > > > > On MMIO a new set of registers is defined for finding SHM > > regions. Add their definition

Re: [PATCH 04/19] virtio: Implement get_shm_region for PCI transport

2019-08-27 Thread Vivek Goyal
On Tue, Aug 27, 2019 at 10:34:57AM +0200, Cornelia Huck wrote: > On Wed, 21 Aug 2019 13:57:05 -0400 > Vivek Goyal wrote: > > > From: Sebastien Boeuf > > > > On PCI the shm regions are found using capability entries; > > find a region by searching f

Re: [PATCH 02/19] dax: Pass dax_dev to dax_writeback_mapping_range()

2019-08-26 Thread Vivek Goyal
On Mon, Aug 26, 2019 at 04:33:26PM -0400, Vivek Goyal wrote: > On Mon, Aug 26, 2019 at 04:53:16AM -0700, Christoph Hellwig wrote: > > On Wed, Aug 21, 2019 at 01:57:03PM -0400, Vivek Goyal wrote: > > > Right now dax_writeback_mapping_range() is passed a bdev and dax_dev >

Re: [PATCH 02/19] dax: Pass dax_dev to dax_writeback_mapping_range()

2019-08-26 Thread Vivek Goyal
On Mon, Aug 26, 2019 at 04:53:16AM -0700, Christoph Hellwig wrote: > On Wed, Aug 21, 2019 at 01:57:03PM -0400, Vivek Goyal wrote: > > Right now dax_writeback_mapping_range() is passed a bdev and dax_dev > > is searched from that bdev name. > > > > virtio-fs do

Re: [Virtio-fs] [PATCH 04/19] virtio: Implement get_shm_region for PCI transport

2019-08-26 Thread Vivek Goyal
On Mon, Aug 26, 2019 at 09:43:08AM +0800, piaojun wrote: [..] > > +static bool vp_get_shm_region(struct virtio_device *vdev, > > + struct virtio_shm_region *region, u8 id) > > +{ > > + struct virtio_pci_device *vp_dev = to_vp_device(vdev); > > + struct pci_dev *pci_dev

Re: [RFC PATCH v2 06/19] fs/ext4: Teach dax_layout_busy_page() to operate on a sub-range

2019-08-23 Thread Vivek Goyal
On Fri, Aug 09, 2019 at 03:58:20PM -0700, ira.we...@intel.com wrote: > From: Ira Weiny > > Callers of dax_layout_busy_page() are only rarely operating on the > entire file of concern. > > Teach dax_layout_busy_page() to operate on a sub-range of the > address_space provided. Specifying 0 -

Re: [PATCH 11/19] fuse, dax: Implement dax read/write operations

2019-08-22 Thread Vivek Goyal
On Wed, Aug 21, 2019 at 12:49:34PM -0700, Liu Bo wrote: [..] > > +static int iomap_begin_upgrade_mapping(struct inode *inode, loff_t pos, > > +loff_t length, unsigned flags, > > +struct iomap *iomap) > > +{ > > + struct

[PATCH v3 00/19][RFC] virtio-fs: Enable DAX support

2019-08-21 Thread Vivek Goyal
ion method virtio: Implement get_shm_region for PCI transport virtio: Implement get_shm_region for MMIO transport Stefan Hajnoczi (4): dax: remove block device dependencies fuse, dax: add fuse_conn->dax_dev field virtio_fs, dax: Set up virtio_fs dax_device fuse, dax: add DAX mmap support

[PATCH 10/19] fuse: Introduce setupmapping/removemapping commands

2019-08-21 Thread Vivek Goyal
Introduce two new fuse commands to setup/remove memory mappings. This will be used to setup/tear down file mapping in dax window. Signed-off-by: Vivek Goyal Signed-off-by: Peng Tao --- include/uapi/linux/fuse.h | 39 +++ 1 file changed, 39 insertions

[PATCH 02/19] dax: Pass dax_dev to dax_writeback_mapping_range()

2019-08-21 Thread Vivek Goyal
Signed-off-by: Vivek Goyal --- fs/dax.c| 16 ++-- fs/ext2/inode.c | 2 +- fs/ext4/inode.c | 2 +- fs/xfs/xfs_aops.c | 2 +- include/linux/dax.h | 6 -- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index a11147bbaf9e

[PATCH 03/19] virtio: Add get_shm_region method

2019-08-21 Thread Vivek Goyal
From: Sebastien Boeuf Virtio defines 'shared memory regions' that provide a continuously shared region between the host and guest. Provide a method to find a particular region on a device. Signed-off-by: Sebastien Boeuf Signed-off-by: Dr. David Alan Gilbert --- include/linux/virtio_config.h

[PATCH 09/19] fuse: implement FUSE_INIT map_alignment field

2019-08-21 Thread Vivek Goyal
The device communicates FUSE_SETUPMAPPING/FUSE_REMOVMAPPING alignment constraints via the FUST_INIT map_alignment field. Parse this field and ensure our DAX mappings meet the alignment constraints. We don't actually align anything differently since our mappings are already 2MB aligned. Just

[PATCH 06/19] fuse, dax: add fuse_conn->dax_dev field

2019-08-21 Thread Vivek Goyal
From: Stefan Hajnoczi A struct dax_device instance is a prerequisite for the DAX filesystem APIs. Let virtio_fs associate a dax_device with a fuse_conn. Classic FUSE and CUSE set the pointer to NULL, disabling DAX. Signed-off-by: Stefan Hajnoczi --- fs/fuse/cuse.c | 3 ++-

[PATCH 18/19] fuse: Release file in process context

2019-08-21 Thread Vivek Goyal
g fuse replies from daemon on the host). That means it blocks worker thread and it stops processing further replies and system deadlocks. So for now, force sync release of file in case of DAX inodes. Signed-off-by: Vivek Goyal --- fs/fuse/file.c | 15 ++- 1 file changed, 14 insertions

[PATCH 08/19] fuse: Keep a list of free dax memory ranges

2019-08-21 Thread Vivek Goyal
Divide the dax memory range into fixed size ranges (2MB for now) and put them in a list. This will track free ranges. Once an inode requires a free range, we will take one from here and put it in interval-tree of ranges assigned to inode. Signed-off-by: Vivek Goyal Signed-off-by: Peng Tao

[PATCH 14/19] fuse, dax: Take ->i_mmap_sem lock during dax page fault

2019-08-21 Thread Vivek Goyal
about circular dependencies. So define a new fuse_inode->i_mmap_sem. Signed-off-by: Vivek Goyal --- fs/fuse/dir.c| 2 ++ fs/fuse/file.c | 17 + fs/fuse/fuse_i.h | 7 +++ fs/fuse/inode.c | 1 + 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/fs/fuse/di

[PATCH 16/19] dax: Create a range version of dax_layout_busy_page()

2019-08-21 Thread Vivek Goyal
While reclaiming a dax range, we do not want to unamap whole file instead want to make sure pages in a certain range do not have references taken on them. Hence create a version of the function which allows to pass in a range. Cc: Dan Williams Signed-off-by: Vivek Goyal --- fs/dax.c

[PATCH 04/19] virtio: Implement get_shm_region for PCI transport

2019-08-21 Thread Vivek Goyal
From: Sebastien Boeuf On PCI the shm regions are found using capability entries; find a region by searching for the capability. Cc: k...@vger.kernel.org Signed-off-by: Sebastien Boeuf Signed-off-by: Dr. David Alan Gilbert Signed-off-by: kbuild test robot ---

[PATCH 11/19] fuse, dax: Implement dax read/write operations

2019-08-21 Thread Vivek Goyal
to daemon (like we do for direct I/O path). This will keep write and i_size change atomic w.r.t crash. Signed-off-by: Stefan Hajnoczi Signed-off-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal Signed-off-by: Miklos Szeredi Signed-off-by: Liu Bo Signed-off-by: Peng Tao --- fs/fuse/file.c

[PATCH 07/19] virtio_fs, dax: Set up virtio_fs dax_device

2019-08-21 Thread Vivek Goyal
. Signed-off-by: Stefan Hajnoczi Signed-off-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal Signed-off-by: Sebastien Boeuf Signed-off-by: Liu Bo --- fs/fuse/fuse_i.h | 1 + fs/fuse/inode.c| 8 +++ fs/fuse/virtio_fs.c| 119

[PATCH 13/19] fuse: Define dax address space operations

2019-08-21 Thread Vivek Goyal
This is done along the lines of ext4 and xfs. I primarily wanted ->writepages hook at this time so that I could call into dax_writeback_mapping_range(). This in turn will decide which pfns need to be written back. Signed-off-by: Vivek Goyal --- fs/fuse/file.c | 19 +++ 1 f

[PATCH 12/19] fuse, dax: add DAX mmap support

2019-08-21 Thread Vivek Goyal
From: Stefan Hajnoczi Add DAX mmap() support. Signed-off-by: Stefan Hajnoczi --- fs/fuse/file.c | 64 +- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index f323b7b04414..32870bb862e7 100644 ---

[PATCH 15/19] fuse: Maintain a list of busy elements

2019-08-21 Thread Vivek Goyal
This list will be used selecting fuse_dax_mapping to free when number of free mappings drops below a threshold. Signed-off-by: Vivek Goyal --- fs/fuse/file.c | 22 ++ fs/fuse/fuse_i.h | 8 fs/fuse/inode.c | 4 3 files changed, 34 insertions(+) diff --git

[PATCH 17/19] fuse: Add logic to free up a memory range

2019-08-21 Thread Vivek Goyal
Signed-off-by: Vivek Goyal Signed-off-by: kbuild test robot Signed-off-by: Liu Bo --- fs/fuse/file.c | 488 +++- fs/fuse/fuse_i.h| 25 +++ fs/fuse/inode.c | 5 + fs/fuse/virtio_fs.c | 10 + 4 files changed, 519 insertions(+), 9 deletions(-)

[PATCH 01/19] dax: remove block device dependencies

2019-08-21 Thread Vivek Goyal
From: Stefan Hajnoczi Although struct dax_device itself is not tied to a block device, some DAX code assumes there is a block device. Make block devices optional by allowing bdev to be NULL in commonly used DAX APIs. When there is no block device: * Skip the partition offset calculation in

[PATCH 19/19] fuse: Take inode lock for dax inode truncation

2019-08-21 Thread Vivek Goyal
-by: Vivek Goyal --- fs/fuse/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index e369a1f92d85..794c55131bd0 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -524,7 +524,7 @@ int fuse_open_common(struct inode *inode, struct file *file

[PATCH 05/19] virtio: Implement get_shm_region for MMIO transport

2019-08-21 Thread Vivek Goyal
From: Sebastien Boeuf On MMIO a new set of registers is defined for finding SHM regions. Add their definitions and use them to find the region. Cc: k...@vger.kernel.org Signed-off-by: Sebastien Boeuf --- drivers/virtio/virtio_mmio.c | 32

[PATCH 10/13] fuse: Separate fuse device allocation and installation in fuse_conn

2019-08-21 Thread Vivek Goyal
fuse devices early and install them into fuse connection later. This patch provides two separate helpers for fuse device allocation and fuse device installation in fuse_conn. Signed-off-by: Vivek Goyal --- fs/fuse/cuse.c | 2 +- fs/fuse/dev.c| 2 +- fs/fuse/fuse_i.h | 4 +++- fs/fuse

[PATCH 08/13] fuse: extract fuse_fill_super_common()

2019-08-21 Thread Vivek Goyal
From: Stefan Hajnoczi fuse_fill_super() includes code to process the fd= option and link the struct fuse_dev to the fd's struct file. In virtio-fs there is no file descriptor because /dev/fuse is not used. This patch extracts fuse_fill_super_common() so that both classic fuse and virtio-fs can

[PATCH 01/13] fuse: delete dentry if timeout is zero

2019-08-21 Thread Vivek Goyal
From: Miklos Szeredi Don't hold onto dentry in lru list if need to re-lookup it anyway at next access. More advanced version of this patch would periodically flush out dentries from the lru which have gone stale. Signed-off-by: Miklos Szeredi --- fs/fuse/dir.c | 26 +++---

[PATCH 09/13] fuse: add fuse_iqueue_ops callbacks

2019-08-21 Thread Vivek Goyal
From: Stefan Hajnoczi The /dev/fuse device uses fiq->waitq and fasync to signal that requests are available. These mechanisms do not apply to virtio-fs. This patch introduces callbacks so alternative behavior can be used. Note that queue_interrupt() changes along these lines:

[PATCH 07/13] Export fuse_dequeue_forget() function

2019-08-21 Thread Vivek Goyal
File systems like virtio-fs need to do not have to play directly with forget list data structures. There is a helper function use that instead. Rename dequeue_forget() to fuse_dequeue_forget() and export it so that stacked filesystems can use it. Signed-off-by: Vivek Goyal --- fs/fuse/dev.c

[PATCH v3 00/13] virtio-fs: shared file system for virtual machines

2019-08-21 Thread Vivek Goyal
tio_fs: add skeleton virtio_fs.ko module Vivek Goyal (5): fuse: Export fuse_send_init_request() Export fuse_dequeue_forget() function fuse: Separate fuse device allocation and installation in fuse_conn virtio-fs: Do not provide abort interface in fusectl init/do_mounts.c: add virtio_fs root

[PATCH 04/13] fuse: export fuse_len_args()

2019-08-21 Thread Vivek Goyal
From: Stefan Hajnoczi virtio-fs will need to query the length of fuse_arg lists. Make the symbol visible. Signed-off-by: Stefan Hajnoczi --- fs/fuse/dev.c| 7 --- fs/fuse/fuse_i.h | 5 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c

[PATCH 11/13] virtio_fs: add skeleton virtio_fs.ko module

2019-08-21 Thread Vivek Goyal
From: Stefan Hajnoczi Add a basic file system module for virtio-fs. Signed-off-by: Stefan Hajnoczi Signed-off-by: Vivek Goyal Signed-off-by: Miklos Szeredi --- fs/fuse/Kconfig | 11 + fs/fuse/Makefile|1 + fs/fuse/fuse_i.h| 12 + fs

[PATCH 03/13] fuse: export fuse_end_request()

2019-08-21 Thread Vivek Goyal
From: Stefan Hajnoczi virtio-fs will need to complete requests from outside fs/fuse/dev.c. Make the symbol visible. Signed-off-by: Stefan Hajnoczi --- fs/fuse/dev.c| 19 ++- fs/fuse/fuse_i.h | 5 + 2 files changed, 15 insertions(+), 9 deletions(-) diff --git

[PATCH 02/13] fuse: Use default_file_splice_read for direct IO

2019-08-21 Thread Vivek Goyal
From: Miklos Szeredi --- fs/fuse/file.c | 15 ++- fs/splice.c| 3 ++- include/linux/fs.h | 2 ++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 5ae2828beb00..c45ffe6f1ecb 100644 --- a/fs/fuse/file.c +++

[PATCH 13/13] init/do_mounts.c: add virtio_fs root fs support

2019-08-21 Thread Vivek Goyal
It is useful to mount the root file system via virtio_fs. During testing a monolithic kernel is more convenient than an initramfs but we'll need to teach the kernel how to boot directly from virtio_fs. Signed-off-by: Stefan Hajnoczi --- init/do_mounts.c | 10 ++ 1 file changed, 10

[PATCH 06/13] fuse: export fuse_get_unique()

2019-08-21 Thread Vivek Goyal
From: Stefan Hajnoczi virtio-fs will need unique IDs for FORGET requests from outside fs/fuse/dev.c. Make the symbol visible. Signed-off-by: Stefan Hajnoczi --- fs/fuse/dev.c| 3 ++- fs/fuse/fuse_i.h | 5 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/fuse/dev.c

[PATCH 12/13] virtio-fs: Do not provide abort interface in fusectl

2019-08-21 Thread Vivek Goyal
virtio-fs does not support aborting requests which are being processed. That is requests which have been sent to fuse daemon on host. So do not provide "abort" interface for virtio-fs in fusectl. Signed-off-by: Vivek Goyal --- fs/fuse/control.c | 4 ++-- fs/fuse/fuse_i.h| 4 +++

[PATCH 05/13] fuse: Export fuse_send_init_request()

2019-08-21 Thread Vivek Goyal
This will be used by virtio-fs to send init request to fuse server after initialization of virt queues. Signed-off-by: Vivek Goyal --- fs/fuse/dev.c| 1 + fs/fuse/fuse_i.h | 1 + fs/fuse/inode.c | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/fuse/dev.c b/fs/fuse

Re: [PATCH v2 18/30] virtio_fs, dax: Set up virtio_fs dax_device

2019-07-18 Thread Vivek Goyal
On Wed, Jul 17, 2019 at 07:27:25PM +0200, Halil Pasic wrote: > On Wed, 15 May 2019 15:27:03 -0400 > Vivek Goyal wrote: > > > From: Stefan Hajnoczi > > > > Setup a dax device. > > > > Use the shm capability to find the cache entry and map it. > > &

Re: [PATCH v2 02/30] fuse: Clear setuid bit even in cache=never path

2019-05-21 Thread Vivek Goyal
On Mon, May 20, 2019 at 04:41:37PM +0200, Miklos Szeredi wrote: > On Wed, May 15, 2019 at 03:26:47PM -0400, Vivek Goyal wrote: > > If fuse daemon is started with cache=never, fuse falls back to direct IO. > > In that write path we don't call file_remove_privs() and that means

Re: [PATCH v2 26/30] fuse: Add logic to free up a memory range

2019-05-20 Thread Vivek Goyal
On Sun, May 19, 2019 at 03:48:05PM +0800, Eric Ren wrote: > Hi, > > @@ -1784,8 +1822,23 @@ static int fuse_iomap_begin(struct inode *inode, > > loff_t pos, loff_t length, > > if (pos >= i_size_read(inode)) > > goto iomap_hole; > > > > -

Re: [PATCH v2 12/30] dax: remove block device dependencies

2019-05-16 Thread Vivek Goyal
On Wed, May 15, 2019 at 05:21:51PM -0700, Dan Williams wrote: [..] > It just seems to me that we should stop pretending that the > filesystem-dax facility requires block devices and try to move this > functionality to generically use a dax device across all interfaces. That sounds reasonable and

[PATCH v2 04/30] fuse: export fuse_end_request()

2019-05-15 Thread Vivek Goyal
From: Stefan Hajnoczi virtio-fs will need to complete requests from outside fs/fuse/dev.c. Make the symbol visible. Signed-off-by: Stefan Hajnoczi --- fs/fuse/dev.c| 19 ++- fs/fuse/fuse_i.h | 5 + 2 files changed, 15 insertions(+), 9 deletions(-) diff --git

[PATCH v2 03/30] fuse: Use default_file_splice_read for direct IO

2019-05-15 Thread Vivek Goyal
From: Miklos Szeredi --- fs/fuse/file.c | 15 ++- fs/splice.c| 3 ++- include/linux/fs.h | 2 ++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 5baf07fd2876..e9a7aa97c539 100644 --- a/fs/fuse/file.c +++

[PATCH v2 01/30] fuse: delete dentry if timeout is zero

2019-05-15 Thread Vivek Goyal
From: Miklos Szeredi Don't hold onto dentry in lru list if need to re-lookup it anyway at next access. More advanced version of this patch would periodically flush out dentries from the lru which have gone stale. Signed-off-by: Miklos Szeredi --- fs/fuse/dir.c | 26 +++---

[PATCH v2 10/30] fuse: Separate fuse device allocation and installation in fuse_conn

2019-05-15 Thread Vivek Goyal
fuse devices early and install them into fuse connection later. This patch provides two separate helpers for fuse device allocation and fuse device installation in fuse_conn. Signed-off-by: Vivek Goyal --- fs/fuse/cuse.c | 2 +- fs/fuse/dev.c| 2 +- fs/fuse/fuse_i.h | 4 +++- fs/fuse

[PATCH v2 14/30] virtio: Add get_shm_region method

2019-05-15 Thread Vivek Goyal
From: Sebastien Boeuf Virtio defines 'shared memory regions' that provide a continuously shared region between the host and guest. Provide a method to find a particular region on a device. Signed-off-by: Sebastien Boeuf Signed-off-by: Dr. David Alan Gilbert --- include/linux/virtio_config.h

[PATCH v2 16/30] virtio: Implement get_shm_region for MMIO transport

2019-05-15 Thread Vivek Goyal
From: Sebastien Boeuf On MMIO a new set of registers is defined for finding SHM regions. Add their definitions and use them to find the region. Signed-off-by: Sebastien Boeuf --- drivers/virtio/virtio_mmio.c | 32 include/uapi/linux/virtio_mmio.h | 11

[PATCH v2 13/30] dax: Pass dax_dev to dax_writeback_mapping_range()

2019-05-15 Thread Vivek Goyal
Right now dax_writeback_mapping_range() is passed a bdev and dax_dev is searched from that bdev name. virtio-fs does not have a bdev. So pass in dax_dev also to dax_writeback_mapping_range(). If dax_dev is passed in, bdev is not used otherwise dax_dev is searched using bdev. Signed-off-by: Vivek

[PATCH v2 05/30] fuse: export fuse_len_args()

2019-05-15 Thread Vivek Goyal
From: Stefan Hajnoczi virtio-fs will need to query the length of fuse_arg lists. Make the symbol visible. Signed-off-by: Stefan Hajnoczi --- fs/fuse/dev.c| 7 --- fs/fuse/fuse_i.h | 5 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c

[PATCH v2 27/30] fuse: Release file in process context

2019-05-15 Thread Vivek Goyal
g fuse replies from daemon on the host). That means it blocks worker thread and it stops processing further replies and system deadlocks. So for now, force sync release of file in case of DAX inodes. Signed-off-by: Vivek Goyal --- fs/fuse/file.c | 15 ++- 1 file changed, 14 insertions

[PATCH v2 29/30] fuse: Take inode lock for dax inode truncation

2019-05-15 Thread Vivek Goyal
-by: Vivek Goyal --- fs/fuse/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 9b82d9b4ebc3..d0979dc32f08 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -420,7 +420,7 @@ int fuse_open_common(struct inode *inode, struct file *file

[PATCH v2 20/30] fuse: Introduce setupmapping/removemapping commands

2019-05-15 Thread Vivek Goyal
Introduce two new fuse commands to setup/remove memory mappings. This will be used to setup/tear down file mapping in dax window. Signed-off-by: Vivek Goyal --- include/uapi/linux/fuse.h | 33 + 1 file changed, 33 insertions(+) diff --git a/include/uapi/linux

[PATCH v2 02/30] fuse: Clear setuid bit even in cache=never path

2019-05-15 Thread Vivek Goyal
/chmod/12.t Signed-off-by: Vivek Goyal --- fs/fuse/file.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 06096b60f1df..5baf07fd2876 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1456,14 +1456,18 @@ static ssize_t

[PATCH v2 21/30] fuse, dax: Implement dax read/write operations

2019-05-15 Thread Vivek Goyal
to daemon (like we do for direct I/O path). This will keep write and i_size change atomic w.r.t crash. Signed-off-by: Stefan Hajnoczi Signed-off-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal Signed-off-by: Miklos Szeredi Signed-off-by: Liu Bo --- fs/fuse/file.c| 454

[PATCH v2 24/30] fuse, dax: Take ->i_mmap_sem lock during dax page fault

2019-05-15 Thread Vivek Goyal
about circular dependencies. So define a new fuse_inode->i_mmap_sem. Signed-off-by: Vivek Goyal --- fs/fuse/dir.c| 2 ++ fs/fuse/file.c | 17 + fs/fuse/fuse_i.h | 7 +++ fs/fuse/inode.c | 1 + 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/fs/fuse/di

[PATCH v2 22/30] fuse, dax: add DAX mmap support

2019-05-15 Thread Vivek Goyal
From: Stefan Hajnoczi Add DAX mmap() support. Signed-off-by: Stefan Hajnoczi --- fs/fuse/file.c | 64 +- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index edbb11ca735e..a053bcb9498d 100644 ---

[PATCH v2 17/30] fuse, dax: add fuse_conn->dax_dev field

2019-05-15 Thread Vivek Goyal
From: Stefan Hajnoczi A struct dax_device instance is a prerequisite for the DAX filesystem APIs. Let virtio_fs associate a dax_device with a fuse_conn. Classic FUSE and CUSE set the pointer to NULL, disabling DAX. Signed-off-by: Stefan Hajnoczi --- fs/fuse/cuse.c | 3 ++-

[PATCH v2 28/30] fuse: Reschedule dax free work if too many EAGAIN attempts

2019-05-15 Thread Vivek Goyal
the dax ranges, all the attempts to acquire lock will fail. So if there are too many inode lock failures (-EAGAIN), reschedule the worker with a 10ms delay. Signed-off-by: Vivek Goyal --- fs/fuse/file.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/fs/fuse

<    1   2   3   4   5   6   7   8   9   10   >