Re: [Qemu-devel] [PATCH v7 6/6] xfs: disable map_sync for async flush

2019-05-07 Thread Pankaj Gupta
> > On Tue, May 07, 2019 at 08:37:01AM -0700, Dan Williams wrote: > > On Thu, Apr 25, 2019 at 10:03 PM Pankaj Gupta wrote: > > > > > > Dont support 'MAP_SYNC' with non-DAX files and DAX files > > > with asynchronous dax_device. Virtio pmem provides > > > asynchronous host page cache flush mecha

Re: [Qemu-devel] [PATCH v7 4/6] dax: check synchronous mapping is supported

2019-05-07 Thread Pankaj Gupta
> > From: Pankaj Gupta > Date: Thu, Apr 25, 2019 at 10:00 PM > > > +static inline bool daxdev_mapping_supported(struct vm_area_struct *vma, > > + struct dax_device *dax_dev) > > +{ > > + return !(vma->flags & VM_SYNC); > > +} > > Shouldn't it be rather `ret

Delivery failed

2019-05-07 Thread Automatic Email Delivery Software
The original message was received at Wed, 8 May 2019 11:35:04 +0800 from lists.01.org [182.75.71.75] - The following addresses had permanent fatal errors - - Transcript of session follows - while talking to lists.01.org.: >>> MAIL From:"Automatic Email Delivery Software" <<< 5

Re: [PATCH ndctl] ndctl, region: return the rc value in region_action

2019-05-07 Thread Yi Zhang
Hi Elliott Thanks for your review. On 4/16/19 2:29 AM, Elliott, Robert (Servers) wrote: -Original Message- From: Linux-nvdimm [mailto:linux-nvdimm-boun...@lists.01.org] On Behalf Of Dan Williams Sent: Monday, April 15, 2019 11:29 AM Subject: Re: [PATCH ndctl] ndctl, region: return th

[ndctl PATCH] contrib: add an example qemu setup script for HMAT emulation

2019-05-07 Thread Vishal Verma
Add a script to demonstrate HMAT emulation using qemu by injecting the initramfs with a made-up ACPI HMAT table. Cc: Dan Williams Originally-authored-by: Keith Busch [vishal: minor shellcheck fixups] Signed-off-by: Vishal Verma --- contrib/daxctl-qemu-hmat-setup | 211 +

[ndctl PATCH v2 06/10] libdaxctl: add an interface to get the mode for a dax device

2019-05-07 Thread Vishal Verma
In preparation for a reconfigure-device command, add an interface to retrieve the 'mode' of a dax device. This will allow the reconfigure-device command (and via daxctl_dev_to_json()), also daxctl-list) to print the mode on device listings via a list command or immediately after a mode change. Cc:

[ndctl PATCH v2 00/10] daxctl: add a new reconfigure-device command

2019-05-07 Thread Vishal Verma
Changes in v2: - Add examples to the documentation page (Dave Hansen) - Clarify documentation regarding the conversion from system-ram to devdax - Remove any references to a persistent config from the documentation - those can be added when the feature is added. - device.c: validate option c

[ndctl PATCH v2 01/10] libdaxctl: add interfaces in support of device modes

2019-05-07 Thread Vishal Verma
In preparation for libdaxctl and daxctl to grow operational modes for DAX devices, add the following supporting APIs: daxctl_dev_get_ctx daxctl_dev_is_enabled Cc: Dan Williams Signed-off-by: Vishal Verma --- daxctl/lib/libdaxctl.c | 30 ++ daxctl/lib/libdaxctl

[ndctl PATCH v2 10/10] contrib/ndctl: add bash-completion for daxctl-reconfigure-device

2019-05-07 Thread Vishal Verma
Add bash completion helpers for the new daxctl-reconfigure-device command. Cc: Dan Williams Signed-off-by: Vishal Verma --- contrib/ndctl | 20 +--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/contrib/ndctl b/contrib/ndctl index d1f8bd6..32c4731 100755 --- a/c

[ndctl PATCH v2 04/10] libdaxctl: add interfaces to get/set the online state for a node

2019-05-07 Thread Vishal Verma
In preparation for converting DAX devices for use as system-ram via the kernel's 'kmem' facility, add libndctl helpers to manipulate the sysfs interfaces to get the target_node of a DAX device, and to online, offline, and query the state of hotplugged memory sections associated with a given node.

[ndctl PATCH v2 02/10] libdaxctl: cache 'subsystem' in daxctl_ctx

2019-05-07 Thread Vishal Verma
The 'DAX subsystem' in effect is determined at region or device init time, and dictates the sysfs base paths for all device/region operations. In preparation for adding bind/unbind functionality, cache the subsystem as determined at init time in the library context. Cc: Dan Williams Signed-off-by

[ndctl PATCH v2 07/10] daxctl: add a new reconfigure-device command

2019-05-07 Thread Vishal Verma
Add a new command 'daxctl-reconfigure-device'. This is used to switch the mode of a dax device between regular 'device_dax' and 'system-memory'. The command also uses the memory hotplug sysfs interfaces to online the newly available memory when converting to 'system-ram', and to attempt to offline

[ndctl PATCH v2 08/10] Documentation/daxctl: add a man page for daxctl-reconfigure-device

2019-05-07 Thread Vishal Verma
Add a man page describing the new daxctl-reconfigure-device command. Cc: Pavel Tatashin Cc: Dave Hansen Cc: Dan Williams Signed-off-by: Vishal Verma --- Documentation/daxctl/Makefile.am | 3 +- .../daxctl/daxctl-reconfigure-device.txt | 118 ++ 2 files chan

[ndctl PATCH v2 09/10] contrib/ndctl: fix region-id completions for daxctl

2019-05-07 Thread Vishal Verma
The completion helpers for daxctl assumed the region arguments for specifying daxctl regions were the same as ndctl regions, i.e. "regionX". This is not true - daxctl region arguments are a simple numeric 'id'. Add a new helper __daxctl_get_regions() to complete daxctl region IDs properly. While

[ndctl PATCH v2 03/10] libdaxctl: add interfaces to enable/disable devices

2019-05-07 Thread Vishal Verma
Add new libdaxctl interfaces to disable a device_dax based devices, and to enable it into a given mode. The modes available are 'device_dax', and 'system-ram', where device_dax is the normal device DAX mode used via a character device, and 'system-ram' uses the kernel's 'kmem' facility to hotplug t

[ndctl PATCH v2 05/10] daxctl/list: add numa_node for device listings

2019-05-07 Thread Vishal Verma
The kernel provides a 'target_node' attribute for dax devices. When converting a dax device to the system-ram mode, the memory is hotplugged into this numa node. It would be helpful to print this in device listings so that it is easy for applications to detect the numa node to which the new memory

[PATCH v2 6/6] mm/devm_memremap_pages: Fix final page put race

2019-05-07 Thread Dan Williams
Logan noticed that devm_memremap_pages_release() kills the percpu_ref drops all the page references that were acquired at init and then immediately proceeds to unplug, arch_remove_memory(), the backing pages for the pagemap. If for some reason device shutdown actually collides with a busy / elevate

[PATCH v2 5/6] PCI/P2PDMA: Track pgmap references per resource, not globally

2019-05-07 Thread Dan Williams
In preparation for fixing a race between devm_memremap_pages_release() and the final put of a page from the device-page-map, allocate a percpu-ref per p2pdma resource mapping. Cc: Logan Gunthorpe Cc: Bjorn Helgaas Cc: Christoph Hellwig Reviewed-by: Ira Weiny Signed-off-by: Dan Williams --- d

[PATCH v2 3/6] PCI/P2PDMA: Fix the gen_pool_add_virt() failure path

2019-05-07 Thread Dan Williams
The pci_p2pdma_add_resource() implementation immediately frees the pgmap if gen_pool_add_virt() fails. However, that means that when @dev triggers a devres release devm_memremap_pages_release() will crash trying to access the freed @pgmap. Use the new devm_memunmap_pages() to manually free the map

[PATCH v2 1/6] drivers/base/devres: Introduce devm_release_action()

2019-05-07 Thread Dan Williams
The devm_add_action() facility allows a resource allocation routine to add custom devm semantics. One such user is devm_memremap_pages(). There is now a need to manually trigger devm_memremap_pages_release(). Introduce devm_release_action() so the release action can be triggered via a new devm_mem

[PATCH v2 0/6] mm/devm_memremap_pages: Fix page release race

2019-05-07 Thread Dan Williams
Changes since v1 [1]: - Fix a NULL-pointer deref crash in pci_p2pdma_release() (Logan) - Refresh the p2pdma patch headers to match the format of other p2pdma patches (Bjorn) - Collect Ira's reviewed-by [1]: https://lore.kernel.org/lkml/155387324370.2443841.574715745262628837.st...@dwillia2-de

[PATCH v2 2/6] mm/devm_memremap_pages: Introduce devm_memunmap_pages

2019-05-07 Thread Dan Williams
Use the new devm_relase_action() facility to allow devm_memremap_pages_release() to be manually triggered. Cc: Logan Gunthorpe Cc: Bjorn Helgaas Cc: Christoph Hellwig Reviewed-by: Ira Weiny Signed-off-by: Dan Williams --- include/linux/memremap.h |6 ++ kernel/memremap.c|

[PATCH v2 4/6] lib/genalloc: Introduce chunk owners

2019-05-07 Thread Dan Williams
The p2pdma facility enables a provider to publish a pool of dma addresses for a consumer to allocate. A genpool is used internally by p2pdma to collect dma resources, 'chunks', to be handed out to consumers. Whenever a consumer allocates a resource it needs to pin the 'struct dev_pagemap' instance

Re: [Qemu-devel] [PATCH v7 2/6] virtio-pmem: Add virtio pmem driver

2019-05-07 Thread Jakub Staroń
On 4/25/19 10:00 PM, Pankaj Gupta wrote: > +void host_ack(struct virtqueue *vq) > +{ > + unsigned int len; > + unsigned long flags; > + struct virtio_pmem_request *req, *req_buf; > + struct virtio_pmem *vpmem = vq->vdev->priv; > + > + spin_lock_irqsave(&vpmem->pmem_lock, flags)

Re: [Qemu-devel] [PATCH v7 4/6] dax: check synchronous mapping is supported

2019-05-07 Thread Jakub Staroń
From: Pankaj Gupta Date: Thu, Apr 25, 2019 at 10:00 PM > +static inline bool daxdev_mapping_supported(struct vm_area_struct *vma, > + struct dax_device *dax_dev) > +{ > + return !(vma->flags & VM_SYNC); > +} Shouldn't it be rather `return !(vma->vm_flags & VM_

RE: [PATCH v2 12/17] kunit: tool: add Python wrappers for running KUnit tests

2019-05-07 Thread Tim.Bird
Here is a bit of inline commentary on the TAP13/TAP14 discussion. > -Original Message- > From: Brendan Higgins > > > On 5/3/19 4:14 PM, Brendan Higgins wrote: > > >> On 5/2/19 10:36 PM, Brendan Higgins wrote: > > > In any case, it sounds like you and Greg are in agreement on the core > >

Re: [PATCH v2 00/17] kunit: introduce KUnit, the Linux kernel unit testing framework

2019-05-07 Thread Theodore Ts'o
On Tue, May 07, 2019 at 10:01:19AM +0200, Greg KH wrote: > > My understanding is that the intent of KUnit is to avoid booting a kernel on > > real hardware or in a virtual machine. That seems to be a matter of > > semantics > > to me because isn't invoking a UML Linux just running the Linux kerne

Re: [PATCH v7 6/6] xfs: disable map_sync for async flush

2019-05-07 Thread Darrick J. Wong
On Tue, May 07, 2019 at 08:37:01AM -0700, Dan Williams wrote: > On Thu, Apr 25, 2019 at 10:03 PM Pankaj Gupta wrote: > > > > Dont support 'MAP_SYNC' with non-DAX files and DAX files > > with asynchronous dax_device. Virtio pmem provides > > asynchronous host page cache flush mechanism. We don't >

Re: [PATCH v7 3/6] libnvdimm: add dax_dev sync flag

2019-05-07 Thread Dan Williams
On Thu, Apr 25, 2019 at 10:02 PM Pankaj Gupta wrote: > > This patch adds 'DAXDEV_SYNC' flag which is set > for nd_region doing synchronous flush. This later > is used to disable MAP_SYNC functionality for > ext4 & xfs filesystem for devices don't support > synchronous flush. > > Signed-off-by: Pan

Re: [PATCH v7 6/6] xfs: disable map_sync for async flush

2019-05-07 Thread Dan Williams
On Thu, Apr 25, 2019 at 10:03 PM Pankaj Gupta wrote: > > Dont support 'MAP_SYNC' with non-DAX files and DAX files > with asynchronous dax_device. Virtio pmem provides > asynchronous host page cache flush mechanism. We don't > support 'MAP_SYNC' with virtio pmem and xfs. > > Signed-off-by: Pankaj G

Re: [PATCH v7 2/6] virtio-pmem: Add virtio pmem driver

2019-05-07 Thread Dan Williams
Hi Pankaj, Some minor file placement comments below. On Thu, Apr 25, 2019 at 10:02 PM Pankaj Gupta wrote: > > This patch adds virtio-pmem driver for KVM guest. > > Guest reads the persistent memory range information from > Qemu over VIRTIO and registers it on nvdimm_bus. It also > creates a nd_r

Re: [PATCH v2 00/17] kunit: introduce KUnit, the Linux kernel unit testing framework

2019-05-07 Thread shuah
On 5/7/19 2:01 AM, Greg KH wrote: On Mon, May 06, 2019 at 08:14:12PM -0700, Frank Rowand wrote: On 5/1/19 4:01 PM, Brendan Higgins wrote: ## TLDR I rebased the last patchset on 5.1-rc7 in hopes that we can get this in 5.2. Shuah, I think you, Greg KH, and myself talked off thread, and we agre

Re: [PATCH v2] drivers/dax: Allow to include DEV_DAX_PMEM as builtin

2019-05-07 Thread Dan Williams
On Tue, May 7, 2019 at 4:50 AM Aneesh Kumar K.V wrote: > > > Hi Dan, > > "Aneesh Kumar K.V" writes: > > > This move the dependency to DEV_DAX_PMEM_COMPAT such that only > > if DEV_DAX_PMEM is built as module we can allow the compat support. > > > > This allows to test the new code easily in a emu

Re: [PATCH v2] drivers/dax: Allow to include DEV_DAX_PMEM as builtin

2019-05-07 Thread Aneesh Kumar K.V
Hi Dan, "Aneesh Kumar K.V" writes: > This move the dependency to DEV_DAX_PMEM_COMPAT such that only > if DEV_DAX_PMEM is built as module we can allow the compat support. > > This allows to test the new code easily in a emulation setup where we > often build things without module support. > > S

Re: [PATCH v2 00/17] kunit: introduce KUnit, the Linux kernel unit testing framework

2019-05-07 Thread Greg KH
On Mon, May 06, 2019 at 08:14:12PM -0700, Frank Rowand wrote: > On 5/1/19 4:01 PM, Brendan Higgins wrote: > > ## TLDR > > > > I rebased the last patchset on 5.1-rc7 in hopes that we can get this in > > 5.2. > > > > Shuah, I think you, Greg KH, and myself talked off thread, and we agreed > > we wo