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

2019-08-13 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-13 02:12:54) > On Tue, Aug 13, 2019 at 2:04 AM Brendan Higgins > wrote: > > > > On Mon, Aug 12, 2019 at 10:30 PM Stephen Boyd wrote: > > > > > > Quoting Brendan Higgins (2019-08-12 22:02:59) > > > > However, now that I added the kunit_resource_destroy, I thought

Re: [RFC PATCH v2 16/19] RDMA/uverbs: Add back pointer to system file object

2019-08-13 Thread Ira Weiny
On Tue, Aug 13, 2019 at 08:48:42AM -0300, Jason Gunthorpe wrote: > On Mon, Aug 12, 2019 at 02:15:37PM -0700, Ira Weiny wrote: > > On Mon, Aug 12, 2019 at 02:56:15PM -0300, Jason Gunthorpe wrote: > > > On Mon, Aug 12, 2019 at 10:28:27AM -0700, Ira Weiny wrote: > > > > On Mon, Aug 12, 2019 at

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

2019-08-13 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-13 00:57:33) > On Mon, Aug 12, 2019 at 9:31 PM Stephen Boyd wrote: > > > > BTW, maybe kunit allocation APIs should > > fail the test if they fail to allocate in general. Unless we're unit > > testing failure to allocate problems. > > Yeah, I thought about that. I

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

2019-08-13 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-13 00:52:03) > On Mon, Aug 12, 2019 at 10:56 PM Stephen Boyd wrote: > > > > Quoting Brendan Higgins (2019-08-12 21:57:55) > > > On Mon, Aug 12, 2019 at 9:22 PM Stephen Boyd wrote: > > > > > > > > Quoting Brendan Higgins (2019-08-12 11:24:12) > > > > > diff --git

Re: [RFC PATCH v2 15/19] mm/gup: Introduce vaddr_pin_pages()

2019-08-13 Thread Ira Weiny
On Tue, Aug 13, 2019 at 08:47:06AM -0300, Jason Gunthorpe wrote: > On Mon, Aug 12, 2019 at 02:48:55PM -0700, Ira Weiny wrote: > > On Mon, Aug 12, 2019 at 09:28:14AM -0300, Jason Gunthorpe wrote: > > > On Fri, Aug 09, 2019 at 03:58:29PM -0700, ira.we...@intel.com wrote: > > > > From: Ira Weiny > >

剖析嵌入式设计师易犯的错误点

2019-08-13 Thread 安獗
Message-ID: 0106639437589 From: =?xdasrm9??= To: 详 情 请 阅 读 附 件 ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [RFC PATCH v2 16/19] RDMA/uverbs: Add back pointer to system file object

2019-08-13 Thread Ira Weiny
On Tue, Aug 13, 2019 at 03:00:22PM -0300, Jason Gunthorpe wrote: > On Tue, Aug 13, 2019 at 10:41:42AM -0700, Ira Weiny wrote: > > > And I was pretty sure uverbs_destroy_ufile_hw() would take care of (or > > ensure > > that some other thread is) destroying all the MR's we have associated with >

Re: [PATCH v3] ndctl, check: Ensure mmap of BTT sections work with 64K page-sizes

2019-08-13 Thread Jeff Moyer
Vaibhav Jain writes: > Thanks for reviewing this patch Jeff. > > Jeff Moyer writes: > >> Vaibhav Jain writes: >> >>> On PPC64 which uses a 64K page-size, ndtl-check command fails on a BTT >>> namespace with following error: >>> >>> $ sudo ndctl check-namespace namespace0.0 -vv >>>

Re: [PATCH v5 1/4] nvdimm: Consider probe return -EOPNOTSUPP as success

2019-08-13 Thread Dan Williams
Hi Aneesh, logic looks correct but there are some cleanups I'd like to see and a lead-in patch that I attached. I've started prefixing nvdimm patches with: libnvdimm/$component: ...since this patch mostly impacts the pmem driver lets prefix it "libnvdimm/pmem: " On Fri, Aug 9, 2019 at

Re: [RFC PATCH v2 15/19] mm/gup: Introduce vaddr_pin_pages()

2019-08-13 Thread John Hubbard
On 8/13/19 10:46 AM, Ira Weiny wrote: > On Tue, Aug 13, 2019 at 08:47:06AM -0300, Jason Gunthorpe wrote: >> On Mon, Aug 12, 2019 at 02:48:55PM -0700, Ira Weiny wrote: >>> On Mon, Aug 12, 2019 at 09:28:14AM -0300, Jason Gunthorpe wrote: On Fri, Aug 09, 2019 at 03:58:29PM -0700,

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

2019-08-13 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 ---

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

2019-08-13 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

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

2019-08-13 Thread Brendan Higgins
Add entry for the new proc sysctl KUnit test to the PROC SYSCTL section, and add Iurii as a maintainer. Signed-off-by: Brendan Higgins Cc: Iurii Zaikin Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Acked-by: Luis Chamberlain --- MAINTAINERS | 2 ++ 1 file changed, 2

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

2019-08-13 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:

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

2019-08-13 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 Reviewed-by: Stephen Boyd ---

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

2019-08-13 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 Cc: Jonathan Corbet Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd

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

2019-08-13 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

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

2019-08-13 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 Reviewed-by: Stephen Boyd --- MAINTAINERS | 11 +++ 1 file changed, 11 insertions(+) diff --git a/MAINTAINERS

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

2019-08-13 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 Reviewed-by: Stephen Boyd --- include/kunit/test.h | 834 ++-

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

2019-08-13 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. string_stream is really just a string builder,

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

2019-08-13 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 Reviewed-by: Stephen Boyd --- kunit/Kconfig | 21 + kunit/Makefile | 4 ++ kunit/example-test.c | 88

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

2019-08-13 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.

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

2019-08-13 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

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

2019-08-13 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

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

2019-08-13 Thread Brendan Higgins
## TL;DR This revision addresses comments from Stephen and Bjorn Helgaas. Most changes are pretty minor stuff that doesn't affect the API in anyway. One significant change, however, is that I added support for freeing kunit_resource managed resources before the test case is finished via

[PATCH v13 04/18] kunit: test: add assertion printing library

2019-08-13 Thread Brendan Higgins
Add `struct kunit_assert` and friends which provide a structured way to capture data from an expectation or an assertion (introduced later in the series) so that it may be printed out in the event of a failure. Signed-off-by: Brendan Higgins Reviewed-by: Stephen Boyd --- include/kunit/assert.h

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

2019-08-13 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 Acked-by: Masahiro Yamada Cc: Michal Marek Reviewed-by: Greg Kroah-Hartman

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

2019-08-13 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

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

2019-08-13 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,

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

2019-08-13 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-12 11:24:16) > 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

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

2019-08-13 Thread Brendan Higgins
On Mon, Aug 12, 2019 at 10:57 PM Stephen Boyd wrote: > > Quoting Brendan Higgins (2019-08-12 22:06:04) > > On Mon, Aug 12, 2019 at 9:24 PM Stephen Boyd wrote: > > > > > > Quoting Brendan Higgins (2019-08-12 11:24:13) > > > > + > > > > +static int kunit_try_catch_test_init(struct kunit *test) > >

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

2019-08-13 Thread Brendan Higgins
On Tue, Aug 13, 2019 at 2:04 AM Brendan Higgins wrote: > > On Mon, Aug 12, 2019 at 10:30 PM Stephen Boyd wrote: > > > > Quoting Brendan Higgins (2019-08-12 22:02:59) > > > On Mon, Aug 12, 2019 at 9:56 PM Stephen Boyd wrote: > > > > > > > > Quoting Brendan Higgins (2019-08-12 17:41:05) > > > > >

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

2019-08-13 Thread Brendan Higgins
On Mon, Aug 12, 2019 at 9:31 PM Stephen Boyd wrote: > > Quoting Brendan Higgins (2019-08-12 11:24:15) > > + > > +static int kunit_resource_test_init(struct kunit *test) > > +{ > > + struct kunit_test_resource_context *ctx = > > + kzalloc(sizeof(*ctx), GFP_KERNEL); > >

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

2019-08-13 Thread Brendan Higgins
On Mon, Aug 12, 2019 at 10:56 PM Stephen Boyd wrote: > > Quoting Brendan Higgins (2019-08-12 21:57:55) > > On Mon, Aug 12, 2019 at 9:22 PM Stephen Boyd wrote: > > > > > > Quoting Brendan Higgins (2019-08-12 11:24:12) > > > > diff --git a/include/kunit/test.h b/include/kunit/test.h > > > > index

Re: [PATCH v3] ndctl, check: Ensure mmap of BTT sections work with 64K page-sizes

2019-08-13 Thread Vaibhav Jain
Thanks for reviewing this patch Jeff. Jeff Moyer writes: > Vaibhav Jain writes: > >> On PPC64 which uses a 64K page-size, ndtl-check command fails on a BTT >> namespace with following error: >> >> $ sudo ndctl check-namespace namespace0.0 -vv >> namespace0.0: namespace_check: checking

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

2019-08-13 Thread Brendan Higgins
On Mon, Aug 12, 2019 at 9:39 PM Stephen Boyd wrote: > > Quoting Brendan Higgins (2019-08-12 11:24:17) > > diff --git a/arch/um/configs/kunit_defconfig > > b/arch/um/configs/kunit_defconfig > > new file mode 100644 > > index 0..bfe49689038f1 > > --- /dev/null > > +++

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

2019-08-13 Thread Brendan Higgins
On Mon, Aug 12, 2019 at 10:30 PM Stephen Boyd wrote: > > Quoting Brendan Higgins (2019-08-12 22:02:59) > > On Mon, Aug 12, 2019 at 9:56 PM Stephen Boyd wrote: > > > > > > Quoting Brendan Higgins (2019-08-12 17:41:05) > > > > On Mon, Aug 12, 2019 at 4:59 PM Stephen Boyd wrote: > > > > > > > > >