Re: [PATCH v5 17/18] kernel/sysctl-test: Add null pointer test for sysctl.c:proc_dointvec()

2019-06-26 Thread Iurii Zaikin
On Tue, Jun 25, 2019 at 7:17 PM Luis Chamberlain wrote: > > On Mon, Jun 17, 2019 at 01:26:12AM -0700, Brendan Higgins wrote: > > From: Iurii Zaikin > > > > KUnit tests for initialized data behavior of proc_dointvec that is > > explicitly checked in the code. Includes basic parsing tests

[PATCH] filesystem-dax: Disable PMD support

2019-06-26 Thread Dan Williams
Ever since the conversion of DAX to the Xarray a RocksDB benchmark has been encountering intermittent lockups. The backtraces always include the filesystem-DAX PMD path, multi-order entries have been a source of bugs in the past, and disabling the PMD path allows a test that fails in minutes to

Re: [PATCH v5 13/18] kunit: tool: add Python wrappers for running KUnit tests

2019-06-26 Thread Brendan Higgins
On Wed, Jun 26, 2019 at 3:03 PM Luis Chamberlain wrote: > > On Wed, Jun 26, 2019 at 01:02:55AM -0700, Brendan Higgins wrote: > > On Tue, Jun 25, 2019 at 5:01 PM Luis Chamberlain wrote: > > > > > > On Mon, Jun 17, 2019 at 01:26:08AM -0700, Brendan Higgins wrote: > > > > create mode 100644 > > >

Re: [PATCH v5 01/18] kunit: test: add KUnit test runner core

2019-06-26 Thread Brendan Higgins
On Wed, Jun 26, 2019 at 3:02 PM Luis Chamberlain wrote: > > On Tue, Jun 25, 2019 at 11:41:47PM -0700, Brendan Higgins wrote: > > On Tue, Jun 25, 2019 at 4:02 PM Luis Chamberlain wrote: > > > > > > On Tue, Jun 25, 2019 at 03:14:45PM -0700, Brendan Higgins wrote: > > > > On Tue, Jun 25, 2019 at

Re: [PATCH v5 01/18] kunit: test: add KUnit test runner core

2019-06-26 Thread Brendan Higgins
On Tue, Jun 25, 2019 at 8:41 PM Stephen Boyd wrote: > > Quoting Brendan Higgins (2019-06-25 13:28:25) > > On Wed, Jun 19, 2019 at 5:15 PM Stephen Boyd wrote: > > > > > > Quoting Brendan Higgins (2019-06-17 01:25:56) > > > > diff --git a/kunit/test.c b/kunit/test.c > > > > new file mode 100644 >

Re: [PATCH v5 01/18] kunit: test: add KUnit test runner core

2019-06-26 Thread Brendan Higgins
On Tue, Jun 25, 2019 at 8:36 PM Luis Chamberlain wrote: > > On Tue, Jun 25, 2019 at 05:07:32PM -0700, Brendan Higgins wrote: > > On Tue, Jun 25, 2019 at 3:33 PM Luis Chamberlain wrote: > > > > > > On Mon, Jun 17, 2019 at 01:25:56AM -0700, Brendan Higgins wrote: > > > > +/** > > > > + *

Re: [PATCH v5 13/18] kunit: tool: add Python wrappers for running KUnit tests

2019-06-26 Thread Luis Chamberlain
On Wed, Jun 26, 2019 at 01:02:55AM -0700, Brendan Higgins wrote: > On Tue, Jun 25, 2019 at 5:01 PM Luis Chamberlain wrote: > > > > On Mon, Jun 17, 2019 at 01:26:08AM -0700, Brendan Higgins wrote: > > > create mode 100644 > > > tools/testing/kunit/test_data/test_is_test_passed-all_passed.log > >

Re: [PATCH v5 01/18] kunit: test: add KUnit test runner core

2019-06-26 Thread Luis Chamberlain
On Tue, Jun 25, 2019 at 11:41:47PM -0700, Brendan Higgins wrote: > On Tue, Jun 25, 2019 at 4:02 PM Luis Chamberlain wrote: > > > > On Tue, Jun 25, 2019 at 03:14:45PM -0700, Brendan Higgins wrote: > > > On Tue, Jun 25, 2019 at 2:44 PM Luis Chamberlain > > > wrote: > > > > Since its a new

Re: [PATCH 17/25] PCI/P2PDMA: use the dev_pagemap internal refcount

2019-06-26 Thread Ira Weiny
On Wed, Jun 26, 2019 at 02:27:16PM +0200, Christoph Hellwig wrote: > The functionality is identical to the one currently open coded in > p2pdma.c. > > Signed-off-by: Christoph Hellwig Reviewed-by: Ira Weiny > --- > drivers/pci/p2pdma.c | 57 > 1

Re: [PATCH 16/25] device-dax: use the dev_pagemap internal refcount

2019-06-26 Thread Ira Weiny
On Wed, Jun 26, 2019 at 02:27:15PM +0200, Christoph Hellwig wrote: > The functionality is identical to the one currently open coded in > device-dax. > > Signed-off-by: Christoph Hellwig Reviewed-by: Ira Weiny > --- > drivers/dax/dax-private.h | 4 > drivers/dax/device.c | 43

Re: [PATCH 15/25] memremap: provide an optional internal refcount in struct dev_pagemap

2019-06-26 Thread Ira Weiny
On Wed, Jun 26, 2019 at 02:27:14PM +0200, Christoph Hellwig wrote: > 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 > --- >

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

2019-06-26 Thread Verma, Vishal L
On Wed, 2019-06-26 at 17:00 -0400, Qian Cai wrote: > > Verma, are you still working on this? I can still see this warning in the > latest > linux-next. > > drivers/nvdimm/btt.c: In function 'btt_read_pg': > drivers/nvdimm/btt.c:1272:8: warning: variable 'rc' set but not used >

Re: [PATCH 24/25] mm: remove the HMM config option

2019-06-26 Thread Ira Weiny
On Wed, Jun 26, 2019 at 02:27:23PM +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 23/25] mm: sort out the DEVICE_PRIVATE Kconfig mess

2019-06-26 Thread Ira Weiny
On Wed, Jun 26, 2019 at 02:27:22PM +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 14/25] memremap: replace the altmap_valid field with a PGMAP_ALTMAP_VALID flag

2019-06-26 Thread Ira Weiny
On Wed, Jun 26, 2019 at 02:27:13PM +0200, Christoph Hellwig wrote: > Add a flags field to struct dev_pagemap to replace the altmap_valid > boolean to be a little more extensible. Also add a pgmap_altmap() helper > to find the optional altmap and clean up the code using the altmap using > it. > >

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

2019-06-26 Thread Qian Cai
On Thu, 2019-05-16 at 00:29 +, Verma, Vishal L wrote: > 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

Re: [PATCH 11/25] memremap: lift the devmap_enable manipulation into devm_memremap_pages

2019-06-26 Thread Ira Weiny
On Wed, Jun 26, 2019 at 02:27:10PM +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. > Also check that a ->page_free is provided for the pgmaps types that > require it,

Re: [PATCH 04/25] mm: remove MEMORY_DEVICE_PUBLIC support

2019-06-26 Thread Ira Weiny
On Wed, Jun 26, 2019 at 10:14:45AM -0700, 'Ira Weiny' wrote: > On Wed, Jun 26, 2019 at 09:00:47AM -0700, Dan Williams wrote: > > [ add Ira ] > > > > On Wed, Jun 26, 2019 at 5:27 AM Christoph Hellwig wrote: > > > > > > The code hasn't been used since it was added to the tree, and doesn't > > >

Re: [PATCH 08/25] memremap: validate the pagemap type passed to devm_memremap_pages

2019-06-26 Thread Ira Weiny
On Wed, Jun 26, 2019 at 02:27:07PM +0200, Christoph Hellwig wrote: > Most pgmap types are only supported when certain config options are > enabled. Check for a type that is valid for the current configuration > before setting up the pagemap. For this the usage of the 0 type for > device dax gets

Re: [PATCH 04/25] mm: remove MEMORY_DEVICE_PUBLIC support

2019-06-26 Thread Ira Weiny
On Wed, Jun 26, 2019 at 09:00:47AM -0700, Dan Williams wrote: > [ add Ira ] > > On Wed, Jun 26, 2019 at 5:27 AM Christoph Hellwig wrote: > > > > The code hasn't been used since it was added to the tree, and doesn't > > appear to actually be usable. > > > > Signed-off-by: Christoph Hellwig > >

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

2019-06-26 Thread Dan Williams
On Tue, Jun 25, 2019 at 10:46 PM Michal Hocko wrote: > > On Tue 25-06-19 12:52:18, Dan Williams wrote: > [...] > > > Documentation/process/stable-api-nonsense.rst > > > > That document has failed to preclude symbol export fights in the past > > and there is a reasonable argument to try not to

Re: [PATCH 04/25] mm: remove MEMORY_DEVICE_PUBLIC support

2019-06-26 Thread Dan Williams
[ add Ira ] On Wed, Jun 26, 2019 at 5:27 AM Christoph Hellwig wrote: > > The code hasn't been used since it was added to the tree, and doesn't > appear to actually be usable. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Jason Gunthorpe > Acked-by: Michal Hocko [..] > diff --git

Re: [PATCH 06/25] mm: export alloc_pages_vma

2019-06-26 Thread Michal Hocko
On Wed 26-06-19 14:27:05, Christoph Hellwig wrote: > nouveau 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 > Reviewed-by: John Hubbard Acked-by: Michal Hocko Thanks! > --- >

[PATCH 20/25] mm: remove hmm_vma_alloc_locked_page

2019-06-26 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 17/25] PCI/P2PDMA: use the dev_pagemap internal refcount

2019-06-26 Thread Christoph Hellwig
The functionality is identical to the one currently open coded in p2pdma.c. Signed-off-by: Christoph Hellwig --- drivers/pci/p2pdma.c | 57 1 file changed, 4 insertions(+), 53 deletions(-) diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c

[PATCH 15/25] memremap: provide an optional internal refcount in struct dev_pagemap

2019-06-26 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 | 64

[PATCH 16/25] device-dax: use the dev_pagemap internal refcount

2019-06-26 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 | 43 --- 2 files changed, 47 deletions(-) diff --git

[PATCH 19/25] nouveau: use devm_memremap_pages directly

2019-06-26 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 | 82 -- 1 file changed, 38 insertions(+), 44

[PATCH 18/25] nouveau: use alloc_page_vma directly

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

[PATCH 24/25] mm: remove the HMM config option

2019-06-26 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 10/25] memremap: pass a struct dev_pagemap to ->kill and ->cleanup

2019-06-26 Thread Christoph Hellwig
Passing the actual typed structure leads to more understandable code vs just passing the ref member. Reported-by: Logan Gunthorpe Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe Reviewed-by: Jason Gunthorpe Reviewed-by: Dan Williams --- drivers/dax/device.c | 12

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

2019-06-26 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 23/25] mm: sort out the DEVICE_PRIVATE Kconfig mess

2019-06-26 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 21/25] mm: remove hmm_devmem_add

2019-06-26 Thread Christoph Hellwig
There isn't really much value add in the hmm_devmem_add wrapper and more, as using devm_memremap_pages directly now is just as simple. Signed-off-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe --- Documentation/vm/hmm.rst | 26 include/linux/hmm.h | 129

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

2019-06-26 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 Reviewed-by: Jason Gunthorpe --- drivers/gpu/drm/nouveau/Kconfig | 1 + mm/Kconfig | 1 -

[PATCH 03/25] mm: remove hmm_devmem_add_resource

2019-06-26 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. Signed-off-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe

[PATCH 14/25] memremap: replace the altmap_valid field with a PGMAP_ALTMAP_VALID flag

2019-06-26 Thread Christoph Hellwig
Add a flags field to struct dev_pagemap to replace the altmap_valid boolean to be a little more extensible. Also add a pgmap_altmap() helper to find the optional altmap and clean up the code using the altmap using it. Signed-off-by: Christoph Hellwig --- arch/powerpc/mm/mem.c | 10

[PATCH 12/25] memremap: add a migrate_to_ram method to struct dev_pagemap_ops

2019-06-26 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 Reviewed-by: Ralph Campbell --- include/linux/hmm.h | 6 --

[PATCH 13/25] memremap: remove the data field in struct dev_pagemap

2019-06-26 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 Reviewed-by: Jason Gunthorpe --- drivers/nvdimm/pmem.c| 2 +- include/linux/memremap.h | 3 +-- kernel/memremap.c| 2 +-

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

2019-06-26 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe --- 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

[PATCH 11/25] memremap: lift the devmap_enable manipulation into devm_memremap_pages

2019-06-26 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. Also check that a ->page_free is provided for the pgmaps types that require it, and check for a valid type as well while we are at it. Note that this also

[PATCH 06/25] mm: export alloc_pages_vma

2019-06-26 Thread Christoph Hellwig
nouveau 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 Reviewed-by: John Hubbard --- mm/mempolicy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index

[PATCH 07/25] mm: factor out a devm_request_free_mem_region helper

2019-06-26 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 Reviewed-by: Jason Gunthorpe Reviewed-by: John Hubbard --- include/linux/ioport.h | 2 ++ kernel/resource.c

[PATCH 09/25] memremap: move dev_pagemap callbacks into a separate structure

2019-06-26 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 Reviewed-by: Logan Gunthorpe Reviewed-by: Jason Gunthorpe ---

[PATCH 05/25] mm: don't clear ->mapping in hmm_devmem_free

2019-06-26 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 04/25] mm: remove MEMORY_DEVICE_PUBLIC support

2019-06-26 Thread Christoph Hellwig
The code hasn't been used since it was added to the tree, and doesn't appear to actually be usable. Signed-off-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Acked-by: Michal Hocko --- include/linux/hmm.h | 4 ++-- include/linux/ioport.h | 1 - include/linux/memremap.h | 8

[PATCH 08/25] memremap: validate the pagemap type passed to devm_memremap_pages

2019-06-26 Thread Christoph Hellwig
Most pgmap types are only supported when certain config options are enabled. Check for a type that is valid for the current configuration before setting up the pagemap. For this the usage of the 0 type for device dax gets replaced with an explicit MEMORY_DEVICE_DEVDAX type. Signed-off-by:

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

2019-06-26 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 Reviewed-by:

dev_pagemap related cleanups v3

2019-06-26 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 Note: this series is on top of Linux 5.2-rc5 and has some minor conflicts with the hmm tree that

Re: [PATCH v5 13/18] kunit: tool: add Python wrappers for running KUnit tests

2019-06-26 Thread Brendan Higgins
On Tue, Jun 25, 2019 at 5:01 PM Luis Chamberlain wrote: > > On Mon, Jun 17, 2019 at 01:26:08AM -0700, Brendan Higgins wrote: > > create mode 100644 > > tools/testing/kunit/test_data/test_is_test_passed-all_passed.log > > create mode 100644 > >

Re: [PATCH v5 07/18] kunit: test: add initial tests

2019-06-26 Thread Brendan Higgins
On Tue, Jun 25, 2019 at 4:22 PM Luis Chamberlain wrote: > > On Mon, Jun 17, 2019 at 01:26:02AM -0700, Brendan Higgins wrote: > > diff --git a/kunit/example-test.c b/kunit/example-test.c > > new file mode 100644 > > index 0..f44b8ece488bb > > --- /dev/null > > +++

Re: [PATCH v5 01/18] kunit: test: add KUnit test runner core

2019-06-26 Thread Brendan Higgins
On Tue, Jun 25, 2019 at 4:02 PM Luis Chamberlain wrote: > > On Tue, Jun 25, 2019 at 03:14:45PM -0700, Brendan Higgins wrote: > > On Tue, Jun 25, 2019 at 2:44 PM Luis Chamberlain wrote: > > > Since its a new architecture and since you seem to imply most tests > > > don't require locking or even

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

2019-06-26 Thread John Hubbard
On 6/25/19 10:45 PM, Michal Hocko wrote: > On Tue 25-06-19 20:15:28, John Hubbard wrote: >> On 6/19/19 12:27 PM, Jason Gunthorpe wrote: >>> On Thu, Jun 13, 2019 at 06:23:04PM -0700, John Hubbard wrote: On 6/13/19 5:43 PM, Ira Weiny wrote: > On Thu, Jun 13, 2019 at 07:58:29PM +, Jason

Re: [PATCH] nvdimm: remove prototypes for nonexistent functions

2019-06-26 Thread Alastair D'Silva
On Wed, 2019-06-26 at 16:03 +1000, Alastair D'Silva wrote: > From: Alastair D'Silva > > These functions don't exist, so remove the prototypes for them. > > Signed-off-by: Alastair D'Silva > --- > drivers/nvdimm/nd-core.h | 4 > 1 file changed, 4 deletions(-) > > diff --git

[PATCH] nvdimm: remove prototypes for nonexistent functions

2019-06-26 Thread Alastair D'Silva
From: Alastair D'Silva These functions don't exist, so remove the prototypes for them. Signed-off-by: Alastair D'Silva --- drivers/nvdimm/nd-core.h | 4 1 file changed, 4 deletions(-) diff --git a/drivers/nvdimm/nd-core.h b/drivers/nvdimm/nd-core.h index 391e88de3a29..57d162dbefaa