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

2019-03-29 Thread Aneesh Kumar K.V
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. Signed-off-by: Aneesh Kumar K.V ---

[PATCH] mm: Fix modifying of page protection by insert_pfn_pmd()

2019-03-29 Thread Aneesh Kumar K.V
With some architectures like ppc64, set_pmd_at() cannot cope with a situation where there is already some (different) valid entry present. Use pmdp_set_access_flags() instead to modify the pfn which is built to deal with modifying existing PMD entries. This is similar to commit cae85cb8add3

Re: [PATCH 5/6] pci/p2pdma: Track pgmap references per resource, not globally

2019-03-29 Thread Dan Williams
On Fri, Mar 29, 2019 at 10:50 AM Logan Gunthorpe wrote: > > Thanks Dan, this is great. I think the changes in this series are > cleaner and more understandable than the patch set I had sent earlier. > > However, I found a couple minor issues with this patch: > > On 2019-03-29 9:27 a.m., Dan

Re: [PATCH 5/6] pci/p2pdma: Track pgmap references per resource, not globally

2019-03-29 Thread Logan Gunthorpe
Thanks Dan, this is great. I think the changes in this series are cleaner and more understandable than the patch set I had sent earlier. However, I found a couple minor issues with this patch: On 2019-03-29 9:27 a.m., Dan Williams wrote: > static void pci_p2pdma_release(void *data) > { >

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

2019-03-29 Thread Ira Weiny
On Fri, Mar 29, 2019 at 08:27:55AM -0700, Dan Williams wrote: > 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

Re: [ndctl PATCH] monitor: removing the requirement of default config

2019-03-29 Thread Verma, Vishal L
On Fri, 2019-03-29 at 20:01 +0900, QI Fuli wrote: > Removing the requirement of default configuration file. > If "-c, --config-file" option is not specified, default configuration > file should be dispensable. > > Link: https://github.com/pmem/ndctl/issues/83 > Signed-off-by: QI Fuli > > ---

Re: [PATCH 3/6] pci/p2pdma: Fix the gen_pool_add_virt() failure path

2019-03-29 Thread Bjorn Helgaas
On Fri, Mar 29, 2019 at 08:27:39AM -0700, Dan Williams wrote: > 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

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

2019-03-29 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 /

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

2019-03-29 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

[PATCH 3/6] pci/p2pdma: Fix the gen_pool_add_virt() failure path

2019-03-29 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

[PATCH 5/6] pci/p2pdma: Track pgmap references per resource, not globally

2019-03-29 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 Signed-off-by: Dan Williams --- drivers/pci/p2pdma.c |

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

2019-03-29 Thread Dan Williams
Logan audited the devm_memremap_pages() shutdown path and noticed that it was possible to proceed to arch_remove_memory() before all potential page references have been reaped. Introduce a new ->cleanup() callback to do the work of waiting for any straggling page references and then perform the

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

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

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

2019-03-29 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

[ndctl PATCH] monitor: removing the requirement of default config

2019-03-29 Thread QI Fuli
Removing the requirement of default configuration file. If "-c, --config-file" option is not specified, default configuration file should be dispensable. Link: https://github.com/pmem/ndctl/issues/83 Signed-off-by: QI Fuli --- ndctl/monitor.c | 7 +-- 1 file changed, 5 insertions(+), 2