Re: [PATCH v9 06/12] mm: Kill is_dev_zone() helper

2019-06-17 Thread Wei Yang
On Wed, Jun 05, 2019 at 02:58:32PM -0700, Dan Williams wrote: >Given there are no more usages of is_dev_zone() outside of 'ifdef >CONFIG_ZONE_DEVICE' protection, kill off the compilation helper. > >Cc: Michal Hocko >Cc: Logan Gunthorpe >Acked-by: David Hildenbrand >Reviewed-by: Oscar Salvador >

RE: ndctl hangs after memory deregistration

2019-06-17 Thread Jacky Wu
Tried on kernel 4.18.20 and this issue is not seen. [root@localhost ~]# ./test-ibv_reg 10.8.8.133 /dev/dax0.0 3 Creating RDMA event channel. Creating RDMA communication identifier. RDMA bind address to 10.8.8.133 RDMA start listen Register memory region. Unregister memory region. Pool unm

Re: [PATCH v9 03/12] mm/hotplug: Prepare shrink_{zone, pgdat}_span for sub-section removal

2019-06-17 Thread Wei Yang
On Wed, Jun 05, 2019 at 02:58:04PM -0700, Dan Williams wrote: >Sub-section hotplug support reduces the unit of operation of hotplug >from section-sized-units (PAGES_PER_SECTION) to sub-section-sized units >(PAGES_PER_SUBSECTION). Teach shrink_{zone,pgdat}_span() to consider >PAGES_PER_SUBSECTION bo

Re: [PATCH v9 02/12] mm/sparsemem: Add helpers track active portions of a section at boot

2019-06-17 Thread Wei Yang
On Mon, Jun 17, 2019 at 03:32:45PM -0700, Dan Williams wrote: >On Mon, Jun 17, 2019 at 3:22 PM Wei Yang wrote: >> >> On Wed, Jun 05, 2019 at 02:57:59PM -0700, Dan Williams wrote: >> >Prepare for hot{plug,remove} of sub-ranges of a section by tracking a >> >sub-section active bitmask, each bit repr

Re: [PATCH v9 02/12] mm/sparsemem: Add helpers track active portions of a section at boot

2019-06-17 Thread Dan Williams
On Mon, Jun 17, 2019 at 3:22 PM Wei Yang wrote: > > On Wed, Jun 05, 2019 at 02:57:59PM -0700, Dan Williams wrote: > >Prepare for hot{plug,remove} of sub-ranges of a section by tracking a > >sub-section active bitmask, each bit representing a PMD_SIZE span of the > >architecture's memory hotplug se

Re: [PATCH v9 02/12] mm/sparsemem: Add helpers track active portions of a section at boot

2019-06-17 Thread Wei Yang
On Wed, Jun 05, 2019 at 02:57:59PM -0700, Dan Williams wrote: >Prepare for hot{plug,remove} of sub-ranges of a section by tracking a >sub-section active bitmask, each bit representing a PMD_SIZE span of the >architecture's memory hotplug section size. > >The implications of a partially populated se

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

2019-06-17 Thread Dan Williams
On Mon, Jun 17, 2019 at 12:59 PM Christoph Hellwig wrote: > > On Mon, Jun 17, 2019 at 10:51:35AM -0700, Dan Williams wrote: > > > - struct dev_pagemap *pgmap = _pgmap; > > > > Whoops, needed to keep this line to avoid: > > > > tools/testing/nvdimm/test/iomap.c:109:11: error: ‘pgmap’ undeclar

[PATCH] libnvdimm: Enable unit test infrastructure compile checks

2019-06-17 Thread Dan Williams
The infrastructure to mock core libnvdimm routines for unit testing purposes is prone to bitrot relative to refactoring of that core. Arrange for the unit test core to be built when CONFIG_COMPILE_TEST=y. This does not result in a functional unit test environment, it is only a helper for 0day to ca

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

2019-06-17 Thread Dan Williams
On Mon, Jun 17, 2019 at 12:59 PM Christoph Hellwig wrote: > > On Mon, Jun 17, 2019 at 12:02:09PM -0700, Dan Williams wrote: > > Need a lead in patch that introduces MEMORY_DEVICE_DEVDAX, otherwise: > > Or maybe a MEMORY_DEVICE_DEFAULT = 0 shared by fsdax and p2pdma? I thought about that, but it s

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

2019-06-17 Thread Logan Gunthorpe
On 2019-06-17 6:27 a.m., Christoph Hellwig wrote: > The functionality is identical to the one currently open coded in > p2pdma.c. > > Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe I also did a quick test with the full patch-set to ensure that the setup and tear down paths fo

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

2019-06-17 Thread Christoph Hellwig
On Mon, Jun 17, 2019 at 02:08:14PM -0600, Logan Gunthorpe wrote: > I just noticed this is missing a line to set pgmap->ops to > pci_p2pdma_pagemap_ops. I must have gotten confused by the other users > in my original review. Though I'm not sure how this compiles as the new > struct is static and unu

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

2019-06-17 Thread Logan Gunthorpe
On 2019-06-17 6:27 a.m., Christoph Hellwig wrote: > diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c > index a98126ad9c3a..e083567d26ef 100644 > --- a/drivers/pci/p2pdma.c > +++ b/drivers/pci/p2pdma.c > @@ -100,7 +100,7 @@ static void pci_p2pdma_percpu_cleanup(struct percpu_ref > *ref)

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

2019-06-17 Thread Christoph Hellwig
On Mon, Jun 17, 2019 at 10:51:35AM -0700, Dan Williams wrote: > > - struct dev_pagemap *pgmap = _pgmap; > > Whoops, needed to keep this line to avoid: > > tools/testing/nvdimm/test/iomap.c:109:11: error: ‘pgmap’ undeclared > (first use in this function); did you mean ‘_pgmap’? So I really

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

2019-06-17 Thread Christoph Hellwig
On Mon, Jun 17, 2019 at 12:02:09PM -0700, Dan Williams wrote: > Need a lead in patch that introduces MEMORY_DEVICE_DEVDAX, otherwise: Or maybe a MEMORY_DEVICE_DEFAULT = 0 shared by fsdax and p2pdma? ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org

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

2019-06-17 Thread Dan Williams
On Mon, Jun 17, 2019 at 5:28 AM 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, and check

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

2019-06-17 Thread Dan Williams
On Mon, Jun 17, 2019 at 5:27 AM 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. > > Signed-off-by: Christoph Hellwig > --- > kernel/memremap.

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

2019-06-17 Thread Dan Williams
On Mon, Jun 17, 2019 at 5:27 AM 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

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

2019-06-17 Thread Christoph Hellwig
On Mon, Jun 17, 2019 at 07:40:18PM +0200, Christoph Hellwig wrote: > On Mon, Jun 17, 2019 at 10:37:12AM -0700, Dan Williams wrote: > > > +struct resource *devm_request_free_mem_region(struct device *dev, > > > + struct resource *base, unsigned long size); > > > > This appears to need

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

2019-06-17 Thread Christoph Hellwig
On Mon, Jun 17, 2019 at 10:37:12AM -0700, Dan Williams wrote: > > +struct resource *devm_request_free_mem_region(struct device *dev, > > + struct resource *base, unsigned long size); > > This appears to need a 'static inline' helper stub in the > CONFIG_DEVICE_PRIVATE=n case, otherwi

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

2019-06-17 Thread Dan Williams
On Mon, Jun 17, 2019 at 5:27 AM 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 > Reviewed-by: Jason Gunthorpe > Reviewed-

Re: [PATCH 5/5] mm/hotplug: export try_online_node

2019-06-17 Thread 'Christoph Hellwig'
On Mon, Jun 17, 2019 at 06:00:00PM +1000, Alastair D'Silva wrote: > > And all that should go through our pmem APIs, not not directly poke into > mm > > internals. And if you still need core patches send them along with the > actual > > driver. > > I tried that, but I was getting crashes as the NU

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

2019-06-17 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 24/25] mm: remove the HMM config option

2019-06-17 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 --- drivers/gpu/drm/nouveau/Kconfi

[PATCH 21/25] mm: mark DEVICE_PUBLIC as broken

2019-06-17 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 Reviewed-by: Jason Gunthorpe --- mm/Kconfig | 1 + 1 file changed, 1 insertion(+)

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

2019-06-17 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 | 56 1 file changed, 4 insertions(+), 52 deletions(-) diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c inde

[PATCH 17/25] nouveau: use alloc_page_vma directly

2019-06-17 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 a/drivers/gpu/drm/nouveau/nouveau_

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

2019-06-17 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 12/25] memremap: remove the data field in struct dev_pagemap

2019-06-17 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 +- mm/hm

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

2019-06-17 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 -- include/linux/memrema

[PATCH 20/25] mm: remove hmm_devmem_add

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

2019-06-17 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 --- drivers/gpu/drm/nou

[PATCH 19/25] mm: remove hmm_vma_alloc_locked_page

2019-06-17 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 a/include/linux/hmm

[PATCH 18/25] nouveau: use devm_memremap_pages directly

2019-06-17 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 deletions(-)

[PATCH 09/25] memremap: pass a struct dev_pagemap to ->kill and ->cleanup

2019-06-17 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 10/25] memremap: lift the devmap_enable manipulation into devm_memremap_pages

2019-06-17 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 f

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

2019-06-17 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 08/25] memremap: move dev_pagemap callbacks into a separate structure

2019-06-17 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 --- drivers/

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

2019-06-17 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. Signed-off-by: Christoph Hellwig --- kernel/memremap.c | 27 +++ 1 file changed, 27 insertions(+) dif

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

2019-06-17 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 a/drivers/dax/dax-private.h

[PATCH 03/25] mm: remove hmm_devmem_add_resource

2019-06-17 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 Review

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

2019-06-17 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

dev_pagemap related cleanups v2

2019-06-17 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 the rdma/hmm branch + the dev_pagemap releas fix series from Dan t

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

2019-06-17 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 de

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

2019-06-17 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: Ja

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

2019-06-17 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: Christoph

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

2019-06-17 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 05/25] mm: export alloc_pages_vma

2019-06-17 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 016

RE: ndctl hangs after memory deregistration

2019-06-17 Thread Jacky Wu
Hi Dan, I wrote a small program to simulate our use case, and tested 3 cases, do no register/unregister, do register only but no unregister, do both register/unregister, and ndctl command hung in latter two cases. I'm attaching the source code for your reference. I will try using latest kerne

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

2019-06-17 Thread Brendan Higgins
From: Iurii Zaikin KUnit tests for initialized data behavior of proc_dointvec that is explicitly checked in the code. Includes basic parsing tests including int min/max overflow. Signed-off-by: Iurii Zaikin Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunt

[PATCH v5 18/18] MAINTAINERS: add proc sysctl KUnit test to PROC SYSCTL section

2019-06-17 Thread Brendan Higgins
Add entry for the new proc sysctl KUnit test to the PROC SYSCTL section. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index f3fb3fc30853e..05cd8ffd33c8f

[PATCH v5 12/18] kunit: test: add tests for KUnit managed resources

2019-06-17 Thread Brendan Higgins
From: Avinash Kondareddy Add unit tests for KUnit managed resources. KUnit managed resources (struct kunit_resource) are resources that are automatically cleaned up at the end of a KUnit test, similar to the concept of devm_* managed resources. Signed-off-by: Avinash Kondareddy Signed-off-by: B

[PATCH v5 10/18] kunit: test: add tests for kunit test abort

2019-06-17 Thread Brendan Higgins
Add KUnit tests for the KUnit test abort mechanism (see preceding commit). Add tests both for general try catch mechanism as well as non-architecture specific mechanism. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe --- kunit/Makefile| 3 +-

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

2019-06-17 Thread Brendan Higgins
Add documentation for KUnit, the Linux kernel unit testing framework. - Add intro and usage guide for KUnit - Add API reference Signed-off-by: Felix Guo Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe --- Documentation/dev-tools/index.rst

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

2019-06-17 Thread Brendan Higgins
From: Felix Guo The ultimate goal is to create minimal isolated test binaries; in the meantime we are using UML to provide the infrastructure to run tests, so define an abstract way to configure and run tests that allow us to change the context in which tests are built without affecting the user.

[PATCH v5 16/18] MAINTAINERS: add entry for KUnit the unit testing framework

2019-06-17 Thread Brendan Higgins
Add myself as maintainer of KUnit, the Linux kernel's unit testing framework. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe --- MAINTAINERS | 11 +++ 1 file changed, 11 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 57f496cff99

[PATCH v5 02/18] kunit: test: add test resource management API

2019-06-17 Thread Brendan Higgins
Create a common API for test managed resources like memory and test objects. A lot of times a test will want to set up infrastructure to be used in test cases; this could be anything from just wanting to allocate some memory to setting up a driver stack; this defines facilities for creating "test r

[PATCH v5 14/18] kunit: defconfig: add defconfigs for building KUnit tests

2019-06-17 Thread Brendan Higgins
Add defconfig for UML and a fragment that can be used to configure other architectures for building KUnit tests. Add option to kunit_tool to use a defconfig to create the kunitconfig. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe --- arch/um/config

[PATCH v5 03/18] kunit: test: add string_stream a std::stream like string builder

2019-06-17 Thread Brendan Higgins
A number of test features need to do pretty complicated string printing where it may not be possible to rely on a single preallocated string with parameters. So provide a library for constructing the string as you go similar to C++'s std::string. Signed-off-by: Brendan Higgins Reviewed-by: Greg

[PATCH v5 05/18] kunit: test: add the concept of expectations

2019-06-17 Thread Brendan Higgins
Add support for expectations, which allow properties to be specified and then verified in tests. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe --- Changes Since Last Revision: - Added typechecking to expectations that compare two things of arbit

[PATCH v5 11/18] kunit: test: add the concept of assertions

2019-06-17 Thread Brendan Higgins
Add support for assertions which are like expectations except the test terminates if the assertion is not satisfied. The idea with assertions is that you use them to state all the preconditions for your test. Logically speaking, these are the premises of the test case, so if a premise isn't true,

[PATCH v5 09/18] kunit: test: add support for test abort

2019-06-17 Thread Brendan Higgins
Add support for aborting/bailing out of test cases, which is needed for implementing assertions. An assertion is like an expectation, but bails out of the test case early if the assertion is not met. The idea with assertions is that you use them to state all the preconditions for your test. Logica

[PATCH v5 08/18] objtool: add kunit_try_catch_throw to the noreturn list

2019-06-17 Thread Brendan Higgins
Fix the following warning seen on GCC 7.3: kunit/test-test.o: warning: objtool: kunit_test_unsuccessful_try() falls through to next function kunit_test_catch() kunit_try_catch_throw is a function added in the following patch in this series; it allows KUnit, a unit testing framework for the kern

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

2019-06-17 Thread Brendan Higgins
Add core facilities for defining unit tests; this provides a common way to define test cases, functions that execute code which is under test and determine whether the code under test behaves as expected; this also provides a way to group together related test cases in test suites (here we call the

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

2019-06-17 Thread Brendan Higgins
Add a test for string stream along with a simpler example. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe --- kunit/Kconfig | 21 + kunit/Makefile | 4 ++ kunit/example-test.c | 88

[PATCH v5 06/18] kbuild: enable building KUnit

2019-06-17 Thread Brendan Higgins
KUnit is a new unit testing framework for the kernel and when used is built into the kernel as a part of it. Add KUnit to the root Kconfig and Makefile to allow it to be actually built. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe --- Kconfig | 2

[PATCH v5 00/18] kunit: introduce KUnit, the Linux kernel unit testing framework

2019-06-17 Thread Brendan Higgins
## TL;DR A not so quick follow-up to Stephen's suggestions on PATCH v4. Nothing that really changes any functionality or usage with the minor exception of a couple public functions that Stephen asked me to rename. Nevertheless, a good deal of clean up and fixes. See changes below. As for our curr

[PATCH v5 04/18] kunit: test: add kunit_stream a std::stream like logger

2019-06-17 Thread Brendan Higgins
A lot of the expectation and assertion infrastructure prints out fairly complicated test failure messages, so add a C++ style log library for for logging test results. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe --- Changes Since Last Revision: -

RE: [PATCH 5/5] mm/hotplug: export try_online_node

2019-06-17 Thread Alastair D'Silva
> -Original Message- > From: Christoph Hellwig > Sent: Monday, 17 June 2019 5:15 PM > To: Alastair D'Silva > Cc: Peter Zijlstra ; Andrew Morton foundation.org>; David Hildenbrand ; Oscar Salvador > ; Michal Hocko ; Pavel Tatashin > ; Wei Yang ; > Arun KS ; Qian Cai ; Thomas Gleixner > ;

Re: [PATCH 5/5] mm/hotplug: export try_online_node

2019-06-17 Thread Christoph Hellwig
On Mon, Jun 17, 2019 at 05:05:30PM +1000, Alastair D'Silva wrote: > On Mon, 2019-06-17 at 08:59 +0200, Peter Zijlstra wrote: > > On Mon, Jun 17, 2019 at 02:36:31PM +1000, Alastair D'Silva wrote: > > > From: Alastair D'Silva > > > > > > If an external driver module supplies physical memory and nee