[PATCH] dax: Fix last_page check in __bdev_dax_supported()

2019-05-15 Thread Vaibhav Jain
Presently __bdev_dax_supported() checks if first sector of last page ( last_page ) on the block device is aligned to page boundary. However the code to compute 'last_page' assumes that there are 8 sectors/page assuming a 4K page-size. This assumption breaks on architectures which use a different

[no subject]

2019-05-15 Thread Mail Delivery Subsystem
This Message was undeliverable due to the following reason: Your message was not delivered because the destination computer was not reachable within the allowed queue period. The amount of time a message is queued before it is returned depends on local configura- tion parameters. Most likely

Re: [GIT PULL] libnvdimm fixes for v5.2-rc1

2019-05-15 Thread pr-tracker-bot
The pull request you sent on Wed, 15 May 2019 17:05:58 -0700: > git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm > tags/libnvdimm-fixes-5.2-rc1 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/83f3ef3de625a5766de2382f9e077d4daafd5bac Thank you! --

Re: [v5 0/3] "Hotremove" persistent memory

2019-05-15 Thread Dan Williams
On Wed, May 15, 2019 at 11:12 AM Pavel Tatashin wrote: > > > Hi Pavel, > > > > I am working on adding this sort of a workflow into a new daxctl command > > (daxctl-reconfigure-device)- this will allow changing the 'mode' of a > > dax device to kmem, online the resulting memory, and with your

Re: [RESEND PATCH] nvdimm: fix some compilation warnings

2019-05-15 Thread Qian Cai
> On May 15, 2019, at 7:25 PM, Dan Williams wrote: > > On Tue, May 14, 2019 at 8:08 AM Qian Cai wrote: >> >> Several places (dimm_devs.c, core.c etc) include label.h but only >> label.c uses NSINDEX_SIGNATURE, so move its definition to label.c >> instead. >> In file included from

Re: [RESEND PATCH] nvdimm: fix some compilation warnings

2019-05-15 Thread Qian Cai
>>} >> >> diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c >> index 7ff684159f29..2eb6a6cfe9e4 100644 >> --- a/drivers/nvdimm/bus.c >> +++ b/drivers/nvdimm/bus.c >> @@ -642,7 +642,7 @@ static struct attribute *nd_device_attributes[] = { >>NULL, >> }; >> >> -/**

Re: [RESEND PATCH] nvdimm: fix some compilation warnings

2019-05-15 Thread Verma, Vishal L
On Wed, 2019-05-15 at 17:26 -0700, Dan Williams wrote: > On Wed, May 15, 2019 at 5:25 PM Verma, Vishal L > wrote: > > On Wed, 2019-05-15 at 16:25 -0700, Dan Williams wrote: > > > > diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c > > > > index 4671776f5623..9f02a99cfac0 100644 > > > >

Re: [RESEND PATCH] nvdimm: fix some compilation warnings

2019-05-15 Thread Dan Williams
On Wed, May 15, 2019 at 5:25 PM Verma, Vishal L wrote: > > On Wed, 2019-05-15 at 16:25 -0700, Dan Williams wrote: > > > > > diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c > > > index 4671776f5623..9f02a99cfac0 100644 > > > --- a/drivers/nvdimm/btt.c > > > +++ b/drivers/nvdimm/btt.c > >

Re: [RESEND PATCH] nvdimm: fix some compilation warnings

2019-05-15 Thread Verma, Vishal L
On Wed, 2019-05-15 at 16:25 -0700, Dan Williams wrote: > > > diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c > > index 4671776f5623..9f02a99cfac0 100644 > > --- a/drivers/nvdimm/btt.c > > +++ b/drivers/nvdimm/btt.c > > @@ -1269,11 +1269,9 @@ static int btt_read_pg(struct btt *btt, struct

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

2019-05-15 Thread Dan Williams
On Wed, May 15, 2019 at 12:28 PM Vivek Goyal wrote: > > 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

Re: [PATCH v9 1/7] libnvdimm: nd_region flush callback support

2019-05-15 Thread Dan Williams
On Tue, May 14, 2019 at 7:55 AM Pankaj Gupta wrote: > > This patch adds functionality to perform flush from guest > to host over VIRTIO. We are registering a callback based > on 'nd_region' type. virtio_pmem driver requires this special > flush function. For rest of the region types we are

Re: [PATCH v9 2/7] virtio-pmem: Add virtio pmem driver

2019-05-15 Thread David Hildenbrand
On 15.05.19 22:46, David Hildenbrand wrote: >> +vpmem->vdev = vdev; >> +vdev->priv = vpmem; >> +err = init_vq(vpmem); >> +if (err) { >> +dev_err(>dev, "failed to initialize virtio pmem vq's\n"); >> +goto out_err; >> +} >> + >> +

Re: [Qemu-devel] [PATCH v9 2/7] virtio-pmem: Add virtio pmem driver

2019-05-15 Thread Dan Williams
On Tue, May 14, 2019 at 8:25 AM Pankaj Gupta wrote: > > > > On 5/14/19 7:54 AM, Pankaj Gupta wrote: > > > diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig > > > index 35897649c24f..94bad084ebab 100644 > > > --- a/drivers/virtio/Kconfig > > > +++ b/drivers/virtio/Kconfig > > > @@ -42,6

Re: [PATCH v9 2/7] virtio-pmem: Add virtio pmem driver

2019-05-15 Thread David Hildenbrand
> + vpmem->vdev = vdev; > + vdev->priv = vpmem; > + err = init_vq(vpmem); > + if (err) { > + dev_err(>dev, "failed to initialize virtio pmem vq's\n"); > + goto out_err; > + } > + > + virtio_cread(vpmem->vdev, struct virtio_pmem_config, > +

Re: [GIT PULL] device-dax for 5.1: PMEM as RAM

2019-05-15 Thread Dan Williams
On Mon, Mar 11, 2019 at 5:08 PM Linus Torvalds wrote: > > On Mon, Mar 11, 2019 at 8:37 AM Dan Williams wrote: > > > > Another feature the userspace tooling can support for the PMEM as RAM > > case is the ability to complete an Address Range Scrub of the range > > before it is added to the

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

2019-05-15 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 v2 11/30] virtio_fs: add skeleton virtio_fs.ko module

2019-05-15 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 --- fs/fuse/Kconfig | 11 + fs/fuse/Makefile| 1 + fs/fuse/fuse_i.h| 13 + fs/fuse/inode.c | 15

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

2019-05-15 Thread Vivek Goyal
Add logic to free up a busy memory range. Freed memory range will be returned to free pool. Add a worker which can be started to select and free some busy memory ranges. In certain cases (write path), process can steal one of its busy dax ranges if free range is not available. If free range is

[PATCH v2 07/30] fuse: export fuse_get_unique()

2019-05-15 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 v2 08/30] fuse: extract fuse_fill_super_common()

2019-05-15 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 v2 02/30] fuse: Clear setuid bit even in cache=never path

2019-05-15 Thread Vivek Goyal
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 setuid bit is not cleared if unpriviliged user writes to a file with setuid bit set. pjdfstest chmod test 12.t tests this and fails. Fix this by calling

[PATCH v2 30/30] virtio-fs: Do not provide abort interface in fusectl

2019-05-15 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 v2 09/30] fuse: add fuse_iqueue_ops callbacks

2019-05-15 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 v2 19/30] fuse: Keep a list of free dax memory ranges

2019-05-15 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 v2 18/30] virtio_fs, dax: Set up virtio_fs dax_device

2019-05-15 Thread Vivek Goyal
From: Stefan Hajnoczi Setup a dax device. Use the shm capability to find the cache entry and map it. The DAX window is accessed by the fs/dax.c infrastructure and must have struct pages (at least on x86). Use devm_memremap_pages() to map the DAX window PCI BAR and allocate struct page.

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

2019-05-15 Thread Vivek Goyal
fuse_dax_free_memory() can be very cpu intensive in corner cases. For example, if one inode has consumed all the memory and a setupmapping request is pending, that means inode lock is held by request and worker thread will not get lock for a while. And given there is only one inode consuming all

[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

[PATCH v2 23/30] fuse: Define dax address space operations

2019-05-15 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 file

[PATCH v2 25/30] fuse: Maintain a list of busy elements

2019-05-15 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 | 8 fs/fuse/fuse_i.h | 7 +++ fs/fuse/inode.c | 4 3 files changed, 19 insertions(+) diff --git a/fs/fuse/file.c

[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 06/30] fuse: Export fuse_send_init_request()

2019-05-15 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

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

2019-05-15 Thread Vivek Goyal
This patch implements basic DAX support. mmap() is not implemented yet and will come in later patches. This patch looks into implemeting read/write. We make use of interval tree to keep track of per inode dax mappings. Do not use dax for file extending writes, instead just send WRITE message to

[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 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 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 27/30] fuse: Release file in process context

2019-05-15 Thread Vivek Goyal
fuse_file_put(sync) can be called with sync=true/false. If sync=true, it waits for release request response and then calls iput() in the caller's context. If sync=false, it does not wait for release request response, frees the fuse_file struct immediately and req->end function does the iput().

[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 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 10/30] fuse: Separate fuse device allocation and installation in fuse_conn

2019-05-15 Thread Vivek Goyal
As of now fuse_dev_alloc() both allocates a fuse device and installs it in fuse_conn list. fuse_dev_alloc() can fail if fuse_device allocation fails. virtio-fs needs to initialize multiple fuse devices (one per virtio queue). It initializes one fuse device as part of call to

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

2019-05-15 Thread Vivek Goyal
When a file is opened with O_TRUNC, we need to make sure that any other DAX operation is not in progress. DAX expects i_size to be stable. In fuse_iomap_begin() we check for i_size at multiple places and we expect i_size to not change. Another problem is, if we setup a mapping in

[PATCH v2 00/30] [RFC] virtio-fs: shared file system for virtual machines

2019-05-15 Thread Vivek Goyal
Hi, Here are the RFC patches for V2 of virtio-fs. These patches apply on top of 5.1 kernel. These patches are also available here. https://github.com/rhvgoyal/linux/commits/virtio-fs-dev-5.1 Patches for V1 were posted here.

[PATCH v2 15/30] virtio: Implement get_shm_region for PCI transport

2019-05-15 Thread Vivek Goyal
From: Sebastien Boeuf On PCI the shm regions are found using capability entries; find a region by searching for the capability. Signed-off-by: Sebastien Boeuf Signed-off-by: Dr. David Alan Gilbert --- drivers/virtio/virtio_pci_modern.c | 108 +

[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 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 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

Re: [v5 0/3] "Hotremove" persistent memory

2019-05-15 Thread Pavel Tatashin
> Hi Pavel, > > I am working on adding this sort of a workflow into a new daxctl command > (daxctl-reconfigure-device)- this will allow changing the 'mode' of a > dax device to kmem, online the resulting memory, and with your patches, > also attempt to offline the memory, and change back to

罗先生:如何提高招聘与面试的知识和技巧

2019-05-15 Thread 罗先生
原邮件信息 - 发件人:罗先生 收件人:linux-nvdimm 发送时间:2019-5-16 2:08:23 ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH v3 15/18] Documentation: kunit: add documentation for KUnit

2019-05-15 Thread Jonathan Corbet
On Tue, 14 May 2019 16:19:02 -0700 Brendan Higgins wrote: > Hmmm...probably premature to bring this up, but Documentation/dev-tools/ > is kind of thrown together. Wait a minute, man... *I* created that directory, are you impugning my work? :) But yes, "kind of thrown together" is a good

Re: [PATCH] dax: Arrange for dax_supported check to span multiple devices

2019-05-15 Thread Pankaj Gupta
> > Pankaj reports that starting with commit ad428cdb525a "dax: Check the > end of the block-device capacity with dax_direct_access()" device-mapper > no longer allows dax operation. This results from the stricter checks in > __bdev_dax_supported() that validate that the start and end of a >

Re: [PATCH] dax: Arrange for dax_supported check to span multiple devices

2019-05-15 Thread Jan Kara
On Tue 14-05-19 20:48:49, Dan Williams wrote: > Pankaj reports that starting with commit ad428cdb525a "dax: Check the > end of the block-device capacity with dax_direct_access()" device-mapper > no longer allows dax operation. This results from the stricter checks in > __bdev_dax_supported() that