Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Jan Kara
On Wed 12-06-19 15:13:36, Ira Weiny wrote: > On Wed, Jun 12, 2019 at 04:14:21PM -0300, Jason Gunthorpe wrote: > > On Wed, Jun 12, 2019 at 02:09:07PM +0200, Jan Kara wrote: > > > On Wed 12-06-19 08:47:21, Jason Gunthorpe wrote: > > > > On Wed, Jun 12, 2019 at 12:29:17PM +0200, Jan Kara wrote: > > >

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Jan Kara
On Wed 12-06-19 11:49:52, Dan Williams wrote: > On Wed, Jun 12, 2019 at 3:29 AM Jan Kara wrote: > > > > On Fri 07-06-19 07:52:13, Ira Weiny wrote: > > > On Fri, Jun 07, 2019 at 09:17:29AM -0300, Jason Gunthorpe wrote: > > > > On Fri, Jun 07, 2019 at 12:36:36PM +0200, Jan Kara wrote: > > > > > > >

[PATCH 16/22] mm: remove hmm_vma_alloc_locked_page

2019-06-13 Thread Christoph Hellwig
The only user of it has just been removed, and there wasn't really any need to wrap a basic memory allocator to start with. Signed-off-by: Christoph Hellwig --- include/linux/hmm.h | 3 --- mm/hmm.c| 14 -- 2 files changed, 17 deletions(-) diff --git

[PATCH 05/22] mm: export alloc_pages_vma

2019-06-13 Thread Christoph Hellwig
noveau is currently using this through an odd hmm wrapper, and I plan to switch it to the real thing later in this series. Signed-off-by: Christoph Hellwig --- mm/mempolicy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 01600d80ae01..f9023b5fba37

[PATCH 08/22] memremap: pass a struct dev_pagemap to ->kill

2019-06-13 Thread Christoph Hellwig
Passing the actual typed structure leads to more understandable code vs the actual references. Signed-off-by: Christoph Hellwig --- drivers/dax/device.c | 7 +++ drivers/nvdimm/pmem.c | 6 +++--- drivers/pci/p2pdma.c | 6 +++--- include/linux/memremap.h

[PATCH 03/22] mm: remove hmm_devmem_add_resource

2019-06-13 Thread Christoph Hellwig
This function has never been used since it was first added to the kernel more than a year and a half ago, and if we ever grow a consumer of the MEMORY_DEVICE_PUBLIC infrastructure it can easily use devm_memremap_pages directly now that we've simplified the API for it. Signed-off-by: Christoph

dev_pagemap related cleanups

2019-06-13 Thread Christoph Hellwig
Hi Dan, Jérôme and Jason, below is a series that cleans up the dev_pagemap interface so that it is more easily usable, which removes the need to wrap it in hmm and thus allowing to kill a lot of code Diffstat: 22 files changed, 245 insertions(+), 802 deletions(-) Git tree:

[PATCH 01/22] mm: remove the unused ARCH_HAS_HMM_DEVICE Kconfig option

2019-06-13 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- mm/Kconfig | 10 -- 1 file changed, 10 deletions(-) diff --git a/mm/Kconfig b/mm/Kconfig index f0c76ba47695..0d2ba7e1f43e 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -675,16 +675,6 @@ config ARCH_HAS_HMM_MIRROR depends on (X86_64 || PPC64)

[PATCH 04/22] mm: don't clear ->mapping in hmm_devmem_free

2019-06-13 Thread Christoph Hellwig
->mapping isn't even used by HMM users, and the field at the same offset in the zone_device part of the union is declared as pad. (Which btw is rather confusing, as DAX uses ->pgmap and ->mapping from two different sides of the union, but DAX doesn't use hmm_devmem_free). Signed-off-by:

[PATCH 02/22] mm: remove the struct hmm_device infrastructure

2019-06-13 Thread Christoph Hellwig
This code is a trivial wrapper around device model helpers, which should have been integrated into the driver device model usage from the start. Assuming it actually had users, which it never had since the code was added more than 1 1/2 years ago. Signed-off-by: Christoph Hellwig ---

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Matthew Wilcox
On Thu, Jun 13, 2019 at 02:36:49PM +1000, Dave Chinner wrote: > On Wed, Jun 12, 2019 at 08:23:20PM -0700, Matthew Wilcox wrote: > > On Thu, Jun 13, 2019 at 10:25:55AM +1000, Dave Chinner wrote: > > > On Wed, Jun 12, 2019 at 05:37:53AM -0700, Matthew Wilcox wrote: > > > > That's rather different

[PATCH 17/22] mm: remove hmm_devmem_add

2019-06-13 Thread Christoph Hellwig
There isn't really much value add in the hmm_devmem_add wrapper. Just factor out a little helper to find the resource, and otherwise let the driver implement the dev_pagemap_ops directly. Signed-off-by: Christoph Hellwig --- Documentation/vm/hmm.rst | 26 include/linux/hmm.h |

[PATCH 18/22] mm: mark DEVICE_PUBLIC as broken

2019-06-13 Thread Christoph Hellwig
The code hasn't been used since it was added to the tree, and doesn't appear to actually be usable. Mark it as BROKEN until either a user comes along or we finally give up on it. Signed-off-by: Christoph Hellwig --- mm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/Kconfig

[PATCH 21/22] mm: remove the HMM config option

2019-06-13 Thread Christoph Hellwig
All the mm/hmm.c code is better keyed off HMM_MIRROR. Also let nouveau depend on it instead of the mix of a dummy dependency symbol plus the actually selected one. Drop various odd dependencies, as the code is pretty portable. Signed-off-by: Christoph Hellwig ---

[PATCH 13/22] device-dax: use the dev_pagemap internal refcount

2019-06-13 Thread Christoph Hellwig
The functionality is identical to the one currently open coded in device-dax. Signed-off-by: Christoph Hellwig --- drivers/dax/dax-private.h | 4 --- drivers/dax/device.c | 52 +-- 2 files changed, 1 insertion(+), 55 deletions(-) diff --git

[PATCH 11/22] memremap: remove the data field in struct dev_pagemap

2019-06-13 Thread Christoph Hellwig
struct dev_pagemap is always embedded into a containing structure, so there is no need to an additional private data field. Signed-off-by: Christoph Hellwig --- drivers/nvdimm/pmem.c| 2 +- include/linux/memremap.h | 3 +-- kernel/memremap.c| 2 +- mm/hmm.c | 9

[PATCH 10/22] memremap: add a migrate callback to struct dev_pagemap_ops

2019-06-13 Thread Christoph Hellwig
This replaces the hacky ->fault callback, which is currently directly called from common code through a hmm specific data structure as an exercise in layering violations. Signed-off-by: Christoph Hellwig --- include/linux/hmm.h | 6 -- include/linux/memremap.h | 6 ++

[PATCH 06/22] mm: factor out a devm_request_free_mem_region helper

2019-06-13 Thread Christoph Hellwig
Keep the physical address allocation that hmm_add_device does with the rest of the resource code, and allow future reuse of it without the hmm wrapper. Signed-off-by: Christoph Hellwig --- include/linux/ioport.h | 2 ++ kernel/resource.c | 39 +++

[PATCH 07/22] memremap: move dev_pagemap callbacks into a separate structure

2019-06-13 Thread Christoph Hellwig
The dev_pagemap is a growing too many callbacks. Move them into a separate ops structure so that they are not duplicated for multiple instances, and an attacker can't easily overwrite them. Signed-off-by: Christoph Hellwig --- drivers/dax/device.c | 6 +-

[PATCH 20/22] mm: sort out the DEVICE_PRIVATE Kconfig mess

2019-06-13 Thread Christoph Hellwig
The ZONE_DEVICE support doesn't depend on anything HMM related, just on various bits of arch support as indicated by the architecture. Also don't select the option from nouveau as it isn't present in many setups, and depend on it instead. Signed-off-by: Christoph Hellwig ---

[PATCH 12/22] memremap: provide an optional internal refcount in struct dev_pagemap

2019-06-13 Thread Christoph Hellwig
Provide an internal refcounting logic if no ->ref field is provided in the pagemap passed into devm_memremap_pages so that callers don't have to reinvent it poorly. Signed-off-by: Christoph Hellwig --- include/linux/memremap.h | 4 +++ kernel/memremap.c | 60

[PATCH 15/22] nouveau: use devm_memremap_pages directly

2019-06-13 Thread Christoph Hellwig
Just use devm_memremap_pages instead of hmm_devmem_add pages to allow killing that wrapper which doesn't provide a whole lot of benefits. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/nouveau/nouveau_dmem.c | 80 -- 1 file changed, 38 insertions(+), 42

[PATCH 09/22] memremap: lift the devmap_enable manipulation into devm_memremap_pages

2019-06-13 Thread Christoph Hellwig
Just check if there is a ->page_free operation set and take care of the static key enable, as well as the put using device managed resources. Signed-off-by: Christoph Hellwig --- drivers/nvdimm/pmem.c | 23 +++-- include/linux/mm.h| 10 kernel/memremap.c | 59

[PATCH 19/22] mm: simplify ZONE_DEVICE page private data

2019-06-13 Thread Christoph Hellwig
Remove the clumsy hmm_devmem_page_{get,set}_drvdata helpers, and instead just access the page directly. Also make the page data a void pointer, and thus much easier to use. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/nouveau/nouveau_dmem.c | 18 +++-- include/linux/hmm.h

[PATCH 14/22] nouveau: use alloc_page_vma directly

2019-06-13 Thread Christoph Hellwig
hmm_vma_alloc_locked_page is scheduled to go away, use the proper mm function directly. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/nouveau/nouveau_dmem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c

[PATCH 22/22] mm: don't select MIGRATE_VMA_HELPER from HMM_MIRROR

2019-06-13 Thread Christoph Hellwig
The migrate_vma helper is only used by noveau to migrate device private pages around. Other HMM_MIRROR users like amdgpu or infiniband don't need it. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/nouveau/Kconfig | 1 + mm/Kconfig | 1 - 2 files changed, 1

Re: dev_pagemap related cleanups

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:03AM +0200, Christoph Hellwig wrote: > Hi Dan, Jérôme and Jason, > > below is a series that cleans up the dev_pagemap interface so that > it is more easily usable, which removes the need to wrap it in hmm > and thus allowing to kill a lot of code Do you want some of

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Matthew Wilcox
On Thu, Jun 13, 2019 at 10:25:55AM +1000, Dave Chinner wrote: > e.g. Process A has an exclusive layout lease on file F. It does an > IO to file F. The filesystem IO path checks that Process A owns the > lease on the file and so skips straight through layout breaking > because it owns the lease and

Re: [PATCH 06/22] mm: factor out a devm_request_free_mem_region helper

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:09AM +0200, Christoph Hellwig wrote: > Keep the physical address allocation that hmm_add_device does with the > rest of the resource code, and allow future reuse of it without the hmm > wrapper. > > Signed-off-by: Christoph Hellwig > include/linux/ioport.h | 2 ++

Re: [PATCH 08/22] memremap: pass a struct dev_pagemap to ->kill

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:11AM +0200, Christoph Hellwig wrote: > Passing the actual typed structure leads to more understandable code > vs the actual references. > > Signed-off-by: Christoph Hellwig > drivers/dax/device.c | 7 +++ > drivers/nvdimm/pmem.c | 6

Re: [PATCH 20/22] mm: sort out the DEVICE_PRIVATE Kconfig mess

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:23AM +0200, Christoph Hellwig wrote: > The ZONE_DEVICE support doesn't depend on anything HMM related, just on > various bits of arch support as indicated by the architecture. Also > don't select the option from nouveau as it isn't present in many setups, > and

Re: [PATCH 08/22] memremap: pass a struct dev_pagemap to ->kill

2019-06-13 Thread Dan Williams
On Thu, Jun 13, 2019 at 1:12 PM Logan Gunthorpe wrote: > > > > On 2019-06-13 3:43 a.m., Christoph Hellwig wrote: > > Passing the actual typed structure leads to more understandable code > > vs the actual references. > > Ha, ok, I originally suggested this to Dan when he introduced the >

Re: dev_pagemap related cleanups

2019-06-13 Thread Logan Gunthorpe
On 2019-06-13 2:21 p.m., Dan Williams wrote: > On Thu, Jun 13, 2019 at 1:18 PM Logan Gunthorpe wrote: >> >> >> >> On 2019-06-13 12:27 p.m., Dan Williams wrote: >>> On Thu, Jun 13, 2019 at 2:43 AM Christoph Hellwig wrote: Hi Dan, Jérôme and Jason, below is a series that

Re: [PATCH 09/22] memremap: lift the devmap_enable manipulation into devm_memremap_pages

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:12AM +0200, Christoph Hellwig wrote: > Just check if there is a ->page_free operation set and take care of the > static key enable, as well as the put using device managed resources. > diff --git a/mm/hmm.c b/mm/hmm.c > index c76a1b5defda..6dc769feb2e1 100644 > +++

Re: [PATCH 18/22] mm: mark DEVICE_PUBLIC as broken

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 12:53:02PM -0700, Ralph Campbell wrote: > > On 6/13/19 12:44 PM, Jason Gunthorpe wrote: > > On Thu, Jun 13, 2019 at 11:43:21AM +0200, Christoph Hellwig wrote: > > > The code hasn't been used since it was added to the tree, and doesn't > > > appear to actually be usable.

Re: [PATCH 22/22] mm: don't select MIGRATE_VMA_HELPER from HMM_MIRROR

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:25AM +0200, Christoph Hellwig wrote: > The migrate_vma helper is only used by noveau to migrate device private > pages around. Other HMM_MIRROR users like amdgpu or infiniband don't > need it. > > Signed-off-by: Christoph Hellwig > --- >

Re: dev_pagemap related cleanups

2019-06-13 Thread Christoph Hellwig
On Thu, Jun 13, 2019 at 08:40:46PM +, Jason Gunthorpe wrote: > > Perhaps we should pull those out and resend them through hmm.git? > > It could be done - but how bad is the conflict resolution? Trivial. All but one patch just apply using git-am, and the other one just has a few lines of

Re: [PATCH 18/22] mm: mark DEVICE_PUBLIC as broken

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:21AM +0200, Christoph Hellwig wrote: > The code hasn't been used since it was added to the tree, and doesn't > appear to actually be usable. Mark it as BROKEN until either a user > comes along or we finally give up on it. > > Signed-off-by: Christoph Hellwig >

Re: [PATCH 09/22] memremap: lift the devmap_enable manipulation into devm_memremap_pages

2019-06-13 Thread Dan Williams
On Thu, Jun 13, 2019 at 12:35 PM Jason Gunthorpe wrote: > > On Thu, Jun 13, 2019 at 11:43:12AM +0200, Christoph Hellwig wrote: > > Just check if there is a ->page_free operation set and take care of the > > static key enable, as well as the put using device managed resources. > > diff --git

Re: [PATCH 07/22] memremap: move dev_pagemap callbacks into a separate structure

2019-06-13 Thread Logan Gunthorpe
On 2019-06-13 3:43 a.m., Christoph Hellwig wrote: > The dev_pagemap is a growing too many callbacks. Move them into a > separate ops structure so that they are not duplicated for multiple > instances, and an attacker can't easily overwrite them. > > Signed-off-by: Christoph Hellwig > --- >

Re: dev_pagemap related cleanups

2019-06-13 Thread Dan Williams
On Thu, Jun 13, 2019 at 1:18 PM Logan Gunthorpe wrote: > > > > On 2019-06-13 12:27 p.m., Dan Williams wrote: > > On Thu, Jun 13, 2019 at 2:43 AM Christoph Hellwig wrote: > >> > >> Hi Dan, Jérôme and Jason, > >> > >> below is a series that cleans up the dev_pagemap interface so that > >> it is

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Ira Weiny
On Thu, Jun 13, 2019 at 10:25:55AM +1000, Dave Chinner wrote: > On Wed, Jun 12, 2019 at 05:37:53AM -0700, Matthew Wilcox wrote: > > On Sat, Jun 08, 2019 at 10:10:36AM +1000, Dave Chinner wrote: > > > On Fri, Jun 07, 2019 at 11:25:35AM -0700, Ira Weiny wrote: > > > > Are you suggesting that we have

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Ira Weiny
On Thu, Jun 13, 2019 at 10:55:52AM +1000, Dave Chinner wrote: > On Wed, Jun 12, 2019 at 04:30:24PM -0700, Ira Weiny wrote: > > On Wed, Jun 12, 2019 at 05:37:53AM -0700, Matthew Wilcox wrote: > > > On Sat, Jun 08, 2019 at 10:10:36AM +1000, Dave Chinner wrote: > > > > On Fri, Jun 07, 2019 at

Re: [PATCH 17/22] mm: remove hmm_devmem_add

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:20AM +0200, Christoph Hellwig wrote: > There isn't really much value add in the hmm_devmem_add wrapper. Just > factor out a little helper to find the resource, and otherwise let the > driver implement the dev_pagemap_ops directly. Was this commit message written

Re: [PATCH 18/22] mm: mark DEVICE_PUBLIC as broken

2019-06-13 Thread Ralph Campbell
On 6/13/19 12:44 PM, Jason Gunthorpe wrote: On Thu, Jun 13, 2019 at 11:43:21AM +0200, Christoph Hellwig wrote: The code hasn't been used since it was added to the tree, and doesn't appear to actually be usable. Mark it as BROKEN until either a user comes along or we finally give up on it.

Re: [PATCH 21/22] mm: remove the HMM config option

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:24AM +0200, Christoph Hellwig wrote: > All the mm/hmm.c code is better keyed off HMM_MIRROR. Also let nouveau > depend on it instead of the mix of a dummy dependency symbol plus the > actually selected one. Drop various odd dependencies, as the code is > pretty

Re: [PATCH 08/22] memremap: pass a struct dev_pagemap to ->kill

2019-06-13 Thread Logan Gunthorpe
On 2019-06-13 3:43 a.m., Christoph Hellwig wrote: > Passing the actual typed structure leads to more understandable code > vs the actual references. Ha, ok, I originally suggested this to Dan when he introduced the callback[1]. Reviewed-by: Logan Gunthorpe Logan [1]

Re: dev_pagemap related cleanups

2019-06-13 Thread Logan Gunthorpe
On 2019-06-13 12:27 p.m., Dan Williams wrote: > On Thu, Jun 13, 2019 at 2:43 AM Christoph Hellwig wrote: >> >> Hi Dan, Jérôme and Jason, >> >> below is a series that cleans up the dev_pagemap interface so that >> it is more easily usable, which removes the need to wrap it in hmm >> and thus

Re: dev_pagemap related cleanups

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:27:39AM -0700, Dan Williams wrote: > On Thu, Jun 13, 2019 at 2:43 AM Christoph Hellwig wrote: > > > > Hi Dan, Jérôme and Jason, > > > > below is a series that cleans up the dev_pagemap interface so that > > it is more easily usable, which removes the need to wrap it in

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Ira Weiny
On Thu, Jun 13, 2019 at 08:27:55AM -0700, Matthew Wilcox wrote: > On Thu, Jun 13, 2019 at 10:25:55AM +1000, Dave Chinner wrote: > > e.g. Process A has an exclusive layout lease on file F. It does an > > IO to file F. The filesystem IO path checks that Process A owns the > > lease on the file and

Re: [PATCH 07/22] memremap: move dev_pagemap callbacks into a separate structure

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:10AM +0200, Christoph Hellwig wrote: > The dev_pagemap is a growing too many callbacks. Move them into a > separate ops structure so that they are not duplicated for multiple > instances, and an attacker can't easily overwrite them. Reviewed-by: Jason Gunthorpe

Re: [PATCH 14/22] nouveau: use alloc_page_vma directly

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:17AM +0200, Christoph Hellwig wrote: > hmm_vma_alloc_locked_page is scheduled to go away, use the proper > mm function directly. > > Signed-off-by: Christoph Hellwig > --- > drivers/gpu/drm/nouveau/nouveau_dmem.c | 3 ++- > 1 file changed, 2 insertions(+), 1

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Dan Williams
On Thu, Jun 13, 2019 at 8:14 AM Jason Gunthorpe wrote: > > On Wed, Jun 12, 2019 at 06:14:46PM -0700, Dan Williams wrote: > > > Effectively, we would need a way for an admin to close a specific file > > > descriptor (or set of fds) which point to that file. AFAIK there is no > > > way to > > >

Re: dev_pagemap related cleanups

2019-06-13 Thread Dan Williams
On Thu, Jun 13, 2019 at 2:43 AM Christoph Hellwig wrote: > > Hi Dan, Jérôme and Jason, > > below is a series that cleans up the dev_pagemap interface so that > it is more easily usable, which removes the need to wrap it in hmm > and thus allowing to kill a lot of code > > Diffstat: > > 22 files

Re: [PATCH 02/22] mm: remove the struct hmm_device infrastructure

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:05AM +0200, Christoph Hellwig wrote: > This code is a trivial wrapper around device model helpers, which > should have been integrated into the driver device model usage from > the start. Assuming it actually had users, which it never had since > the code was added

Re: [PATCH 03/22] mm: remove hmm_devmem_add_resource

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:06AM +0200, Christoph Hellwig wrote: > This function has never been used since it was first added to the kernel > more than a year and a half ago, and if we ever grow a consumer of the > MEMORY_DEVICE_PUBLIC infrastructure it can easily use devm_memremap_pages >

Re: [PATCH 01/22] mm: remove the unused ARCH_HAS_HMM_DEVICE Kconfig option

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:04AM +0200, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig > --- > mm/Kconfig | 10 -- > 1 file changed, 10 deletions(-) So long as we are willing to run a hmm.git we can merge only complete features going forward. Thus we don't need the crazy

Re: [PATCH 04/22] mm: don't clear ->mapping in hmm_devmem_free

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:07AM +0200, Christoph Hellwig wrote: > ->mapping isn't even used by HMM users, and the field at the same offset > in the zone_device part of the union is declared as pad. (Which btw is > rather confusing, as DAX uses ->pgmap and ->mapping from two different > sides

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Dan Williams
On Wed, Jun 12, 2019 at 4:32 PM Ira Weiny wrote: > > On Wed, Jun 12, 2019 at 03:54:19PM -0700, Dan Williams wrote: > > On Wed, Jun 12, 2019 at 3:12 PM Ira Weiny wrote: > > > > > > On Wed, Jun 12, 2019 at 04:14:21PM -0300, Jason Gunthorpe wrote: > > > > On Wed, Jun 12, 2019 at 02:09:07PM +0200,

Re: [Nouveau] [PATCH 02/22] mm: remove the struct hmm_device infrastructure

2019-06-13 Thread John Hubbard
On 6/13/19 2:43 AM, Christoph Hellwig wrote: > This code is a trivial wrapper around device model helpers, which > should have been integrated into the driver device model usage from > the start. Assuming it actually had users, which it never had since > the code was added more than 1 1/2 years

Re: [PATCH 04/22] mm: don't clear ->mapping in hmm_devmem_free

2019-06-13 Thread John Hubbard
On 6/13/19 2:43 AM, Christoph Hellwig wrote: > ->mapping isn't even used by HMM users, and the field at the same offset > in the zone_device part of the union is declared as pad. (Which btw is > rather confusing, as DAX uses ->pgmap and ->mapping from two different > sides of the union, but DAX

Re: [PATCH 05/22] mm: export alloc_pages_vma

2019-06-13 Thread John Hubbard
On 6/13/19 2:43 AM, Christoph Hellwig wrote: > noveau is currently using this through an odd hmm wrapper, and I plan "nouveau" > to switch it to the real thing later in this series. > > Signed-off-by: Christoph Hellwig > --- Reviewed-by: John Hubbard thanks, -- John Hubbard NVIDIA >

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Matthew Wilcox
On Fri, Jun 14, 2019 at 12:09:21PM +1000, Dave Chinner wrote: > On Thu, Jun 13, 2019 at 08:45:30PM -0300, Jason Gunthorpe wrote: > > On Thu, Jun 13, 2019 at 02:13:21PM -0700, Ira Weiny wrote: > > > On Thu, Jun 13, 2019 at 08:27:55AM -0700, Matthew Wilcox wrote: > > > > On Thu, Jun 13, 2019 at

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Dave Chinner
On Thu, Jun 13, 2019 at 01:34:05PM -0700, Ira Weiny wrote: > On Thu, Jun 13, 2019 at 10:25:55AM +1000, Dave Chinner wrote: > > On Wed, Jun 12, 2019 at 05:37:53AM -0700, Matthew Wilcox wrote: > > > On Sat, Jun 08, 2019 at 10:10:36AM +1000, Dave Chinner wrote: > > > > On Fri, Jun 07, 2019 at

Re: [PATCH 10/22] memremap: add a migrate callback to struct dev_pagemap_ops

2019-06-13 Thread Ralph Campbell
On 6/13/19 2:43 AM, Christoph Hellwig wrote: This replaces the hacky ->fault callback, which is currently directly called from common code through a hmm specific data structure as an exercise in layering violations. Signed-off-by: Christoph Hellwig --- include/linux/hmm.h | 6 --

Re: dev_pagemap related cleanups

2019-06-13 Thread Ira Weiny
On Thu, Jun 13, 2019 at 08:40:46PM +, Jason Gunthorpe wrote: > On Thu, Jun 13, 2019 at 11:27:39AM -0700, Dan Williams wrote: > > On Thu, Jun 13, 2019 at 2:43 AM Christoph Hellwig wrote: > > > > > > Hi Dan, Jérôme and Jason, > > > > > > below is a series that cleans up the dev_pagemap

Re: [PATCH 18/22] mm: mark DEVICE_PUBLIC as broken

2019-06-13 Thread John Hubbard
On 6/13/19 5:43 PM, Ira Weiny wrote: > On Thu, Jun 13, 2019 at 07:58:29PM +, Jason Gunthorpe wrote: >> On Thu, Jun 13, 2019 at 12:53:02PM -0700, Ralph Campbell wrote: >>> ... >> Hum, so the only thing this config does is short circuit here: >> >> static inline bool is_device_public_page(const

Re: [Nouveau] [PATCH 22/22] mm: don't select MIGRATE_VMA_HELPER from HMM_MIRROR

2019-06-13 Thread John Hubbard
On 6/13/19 2:43 AM, Christoph Hellwig wrote: > The migrate_vma helper is only used by noveau to migrate device private > pages around. Other HMM_MIRROR users like amdgpu or infiniband don't > need it. > > Signed-off-by: Christoph Hellwig > --- > drivers/gpu/drm/nouveau/Kconfig | 1 + >

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Jan Kara
On Wed 12-06-19 11:41:53, Dan Williams wrote: > On Wed, Jun 12, 2019 at 5:09 AM Jan Kara wrote: > > > > On Wed 12-06-19 08:47:21, Jason Gunthorpe wrote: > > > On Wed, Jun 12, 2019 at 12:29:17PM +0200, Jan Kara wrote: > > > > > > > > > The main objection to the current ODP & DAX solution is that

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Dave Chinner
On Thu, Jun 13, 2019 at 01:34:06PM -0700, Ira Weiny wrote: > On Thu, Jun 13, 2019 at 10:55:52AM +1000, Dave Chinner wrote: > > On Wed, Jun 12, 2019 at 04:30:24PM -0700, Ira Weiny wrote: > > > On Wed, Jun 12, 2019 at 05:37:53AM -0700, Matthew Wilcox wrote: > > > > On Sat, Jun 08, 2019 at 10:10:36AM

Re: dev_pagemap related cleanups

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:21:01PM +0200, Christoph Hellwig wrote: > On Thu, Jun 13, 2019 at 08:40:46PM +, Jason Gunthorpe wrote: > > > Perhaps we should pull those out and resend them through hmm.git? > > > > It could be done - but how bad is the conflict resolution? > > Trivial. All but

Re: ndctl hangs after memory deregistration

2019-06-13 Thread Yue Li
Thanks Dan for the reply! On 6/14/19, 3:06 AM, "Dan Williams" wrote: On Wed, Jun 12, 2019 at 9:08 PM Yue Li wrote: > > hi Dan and Steve, > > Hi, I just happened to see this by luck, please use my Intel address, and copy the libnvdimm mailing list on

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Ira Weiny
On Thu, Jun 13, 2019 at 08:45:30PM -0300, Jason Gunthorpe wrote: > On Thu, Jun 13, 2019 at 02:13:21PM -0700, Ira Weiny wrote: > > On Thu, Jun 13, 2019 at 08:27:55AM -0700, Matthew Wilcox wrote: > > > On Thu, Jun 13, 2019 at 10:25:55AM +1000, Dave Chinner wrote: > > > > e.g. Process A has an

Re: [PATCH 13/22] device-dax: use the dev_pagemap internal refcount

2019-06-13 Thread Ira Weiny
On Thu, Jun 13, 2019 at 11:43:16AM +0200, Christoph Hellwig wrote: > The functionality is identical to the one currently open coded in > device-dax. > > Signed-off-by: Christoph Hellwig > --- > drivers/dax/dax-private.h | 4 --- > drivers/dax/device.c | 52

Re: [PATCH 18/22] mm: mark DEVICE_PUBLIC as broken

2019-06-13 Thread Ira Weiny
On Thu, Jun 13, 2019 at 07:58:29PM +, Jason Gunthorpe wrote: > On Thu, Jun 13, 2019 at 12:53:02PM -0700, Ralph Campbell wrote: > > > > On 6/13/19 12:44 PM, Jason Gunthorpe wrote: > > > On Thu, Jun 13, 2019 at 11:43:21AM +0200, Christoph Hellwig wrote: > > > > The code hasn't been used since

Re: [Nouveau] [PATCH 03/22] mm: remove hmm_devmem_add_resource

2019-06-13 Thread John Hubbard
On 6/13/19 2:43 AM, Christoph Hellwig wrote: > This function has never been used since it was first added to the kernel > more than a year and a half ago, and if we ever grow a consumer of the > MEMORY_DEVICE_PUBLIC infrastructure it can easily use devm_memremap_pages > directly now that we've

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Dave Chinner
On Thu, Jun 13, 2019 at 08:45:30PM -0300, Jason Gunthorpe wrote: > On Thu, Jun 13, 2019 at 02:13:21PM -0700, Ira Weiny wrote: > > On Thu, Jun 13, 2019 at 08:27:55AM -0700, Matthew Wilcox wrote: > > > On Thu, Jun 13, 2019 at 10:25:55AM +1000, Dave Chinner wrote: > > > > e.g. Process A has an

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Dave Chinner
On Thu, Jun 13, 2019 at 07:31:07PM -0700, Matthew Wilcox wrote: > On Fri, Jun 14, 2019 at 12:09:21PM +1000, Dave Chinner wrote: > > If the lease holder modifies the mapping in a way that causes it's > > own internal state to screw up, then that's a bug in the lease > > holder application. > >