Re: [PATCH] dax: Fix missed PMD wakeups

2019-07-03 Thread Matthew Wilcox
On Wed, Jul 03, 2019 at 02:28:41PM -0700, Dan Williams wrote: > On Wed, Jul 3, 2019 at 12:53 PM Matthew Wilcox wrote: > > @@ -211,7 +215,8 @@ static void *get_unlocked_entry(struct xa_state *xas) > > for (;;) { > > entry = xas_find_conflict(xas); > > if

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

2019-07-03 Thread Vaibhav Jain
Presently on PPC64 which uses a 64K page-size, ndtl-check command fails on a BTT device with following error: $sudo ndctl check-namespace namespace0.0 -vv namespace0.0: namespace_check: checking namespace0.0 namespace0.0: btt_discover_arenas: found 1 BTT arena namespace0.0: btt_create_mappings:

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

2019-07-03 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 Acked-by: Luis Chamberlain --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index

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

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

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

2019-07-03 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 v6 14/18] kunit: defconfig: add defconfigs for building KUnit tests

2019-07-03 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 v6 13/18] kunit: tool: add Python wrappers for running KUnit tests

2019-07-03 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 v6 15/18] Documentation: kunit: add documentation for KUnit

2019-07-03 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 --- Changes Since Last Revision: - Fixed a

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

2019-07-03 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 v6 11/18] kunit: test: add the concept of assertions

2019-07-03 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 v6 08/18] objtool: add kunit_try_catch_throw to the noreturn list

2019-07-03 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 v6 09/18] kunit: test: add support for test abort

2019-07-03 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 v6 10/18] kunit: test: add tests for kunit test abort

2019-07-03 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 v6 06/18] kbuild: enable building KUnit

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

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

2019-07-03 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 --- include/kunit/kunit-stream.h

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

2019-07-03 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 --- include/kunit/test.h | 525 +++ kunit/test.c | 66

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

2019-07-03 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 v6 02/18] kunit: test: add test resource management API

2019-07-03 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 v6 00/18] kunit: introduce KUnit, the Linux kernel unit testing framework

2019-07-03 Thread Brendan Higgins
## TL;DR This is a pretty straightforward follow-up to Stephen and Luis' comments on PATCH v5: There is nothing that really changes any functionality or usage with the minor exception that I renamed `struct kunit_module` to `struct kunit_suite`. Nevertheless, a good deal of clean ups and fixes.

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

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

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

2019-07-03 Thread Brendan Higgins
On Fri, Jun 21, 2019 at 5:54 PM Brendan Higgins wrote: > > On Fri, Jun 21, 2019 at 12:21 PM shuah wrote: > > > > On 6/21/19 12:13 PM, Theodore Ts'o wrote: > > > On Fri, Jun 21, 2019 at 08:59:48AM -0600, shuah wrote: > > ### But wait! Doesn't kselftest support in kernel testing?! > > >

Re: [PATCH] dax: Fix missed PMD wakeups

2019-07-03 Thread Dan Williams
On Wed, Jul 3, 2019 at 12:53 PM Matthew Wilcox wrote: > > On Wed, Jul 03, 2019 at 10:01:37AM -0700, Dan Williams wrote: > > On Wed, Jul 3, 2019 at 5:17 AM Matthew Wilcox wrote: > > > > > > On Wed, Jul 03, 2019 at 12:24:54AM -0700, Dan Williams wrote: > > > > This fix may increase waitqueue

Re: [PATCH] dax: Fix missed PMD wakeups

2019-07-03 Thread Matthew Wilcox
On Wed, Jul 03, 2019 at 10:01:37AM -0700, Dan Williams wrote: > On Wed, Jul 3, 2019 at 5:17 AM Matthew Wilcox wrote: > > > > On Wed, Jul 03, 2019 at 12:24:54AM -0700, Dan Williams wrote: > > > This fix may increase waitqueue contention, but a fix for that is saved > > > for a larger rework. In

Re: [PATCH 20/22] mm: move hmm_vma_fault to nouveau

2019-07-03 Thread Christoph Hellwig
On Wed, Jul 03, 2019 at 03:03:56PM -0300, Jason Gunthorpe wrote: > I was thinking about doing exactly this too, but amdgpu started using > this already obsolete API in their latest driver :( > > So, we now need to get both drivers to move to the modern API. Actually the AMD folks fixed this up

Re: [PATCH 22/22] mm: remove the legacy hmm_pfn_* APIs

2019-07-03 Thread Christoph Hellwig
On Wed, Jul 03, 2019 at 03:01:25PM -0300, Jason Gunthorpe wrote: > Christoph, I guess you didn't mean to send this branch to the mailing > list? > > In any event some of these, like this one, look obvious and I could > still grab a few for hmm.git. > > Let me know what you'd like please > >

Re: [Nouveau] [PATCH 20/22] mm: move hmm_vma_fault to nouveau

2019-07-03 Thread Ilia Mirkin
On Wed, Jul 3, 2019 at 1:49 PM Ralph Campbell wrote: > On 6/30/19 11:20 PM, Christoph Hellwig wrote: > > hmm_vma_fault is marked as a legacy API to get rid of, but quite suites > > the current nouvea flow. Move it to the only user in preparation for > > I didn't quite parse the phrase "quite

Re: [PATCH 20/22] mm: move hmm_vma_fault to nouveau

2019-07-03 Thread Ralph Campbell
On 6/30/19 11:20 PM, Christoph Hellwig wrote: hmm_vma_fault is marked as a legacy API to get rid of, but quite suites the current nouvea flow. Move it to the only user in preparation for I didn't quite parse the phrase "quite suites the current nouvea flow." s/nouvea/nouveau/ fixing a

Re: [PATCH 19/22] mm: always return EBUSY for invalid ranges in hmm_range_{fault,snapshot}

2019-07-03 Thread Ralph Campbell
On 6/30/19 11:20 PM, Christoph Hellwig wrote: We should not have two different error codes for the same condition. In addition this really complicates the code due to the special handling of EAGAIN that drops the mmap_sem due to the FAULT_FLAG_ALLOW_RETRY logic in the core vm. Signed-off-by:

Re: [PATCH 18/22] mm: return valid info from hmm_range_unregister

2019-07-03 Thread Ralph Campbell
On 6/30/19 11:20 PM, Christoph Hellwig wrote: Checking range->valid is trivial and has no meaningful cost, but nicely simplifies the fastpath in typical callers. Also remove the hmm_vma_range_done function, which now is a trivial wrapper around hmm_range_unregister. Signed-off-by: Christoph

Re: [PATCH] dax: Fix missed PMD wakeups

2019-07-03 Thread Dan Williams
On Wed, Jul 3, 2019 at 5:17 AM Matthew Wilcox wrote: > > On Wed, Jul 03, 2019 at 12:24:54AM -0700, Dan Williams wrote: > > This fix may increase waitqueue contention, but a fix for that is saved > > for a larger rework. In the meantime this fix is suitable for -stable > > backports. > > I think

Re: [PATCH] filesystem-dax: Disable PMD support

2019-07-03 Thread Matthew Wilcox
On Mon, Jul 01, 2019 at 02:11:19PM +0200, Jan Kara wrote: > BTW, looking into the xarray code, I think I found another difference > between the old radix tree code and the new xarray code that could cause > issues. In the old radix tree code if we tried to insert PMD entry but > there was some PTE

Re: [PATCH] dax: Fix missed PMD wakeups

2019-07-03 Thread Matthew Wilcox
On Wed, Jul 03, 2019 at 12:24:54AM -0700, Dan Williams wrote: > This fix may increase waitqueue contention, but a fix for that is saved > for a larger rework. In the meantime this fix is suitable for -stable > backports. I think this is too big for what it is; just the two-line patch to stop

Re: [PATCH v4 10/10] acpi/numa/hmat: Register "specific purpose" memory as an "hmem" device

2019-07-03 Thread Rafael J. Wysocki
On Mon, Jun 24, 2019 at 8:34 PM Dan Williams wrote: > > Memory that has been tagged EFI_MEMORY_SP, and has performance > properties described by the ACPI HMAT is expected to have an application > specific consumer. > > Those consumers may want 100% of the memory capacity to be reserved from > any

Re: [PATCH v4 09/10] acpi/numa/hmat: Register HMAT at device_initcall level

2019-07-03 Thread Rafael J. Wysocki
On Mon, Jun 24, 2019 at 8:34 PM Dan Williams wrote: > > In preparation for registering device-dax instances for accessing EFI > specific-purpose memory, arrange for the HMAT registration to occur > later in the init process. Critically HMAT initialization needs to occur > after

Re: [PATCH v4 02/10] acpi/numa/hmat: Skip publishing target info for nodes with no online memory

2019-07-03 Thread Rafael J. Wysocki
On Mon, Jun 24, 2019 at 8:33 PM Dan Williams wrote: > > There are multiple scenarios where the HMAT may contain information > about proximity domains that are not currently online. Rather than fail > to report any HMAT data just elide those offline domains. > > If and when those domains are later

Re: [PATCH v4 01/10] acpi/numa: Establish a new drivers/acpi/numa/ directory

2019-07-03 Thread Rafael J. Wysocki
On Mon, Jun 24, 2019 at 8:33 PM Dan Williams wrote: > > Currently hmat.c lives under an "hmat" directory which does not enhance > the description of the file. The initial motivation for giving hmat.c > its own directory was to delineate it as mm functionality in contrast to > ACPI device driver

Re: [PATCH] filesystem-dax: Disable PMD support

2019-07-03 Thread Jan Kara
On Sun 30-06-19 08:23:24, Matthew Wilcox wrote: > On Sun, Jun 30, 2019 at 01:01:04AM -0700, Dan Williams wrote: > > @@ -215,7 +216,7 @@ static wait_queue_head_t > > *dax_entry_waitqueue(struct xa_state *xas, > > * queue to the start of that PMD. This ensures that all offsets in > >

[PATCH] dax: Fix missed PMD wakeups

2019-07-03 Thread Dan Williams
Ever since the conversion of DAX to the Xarray a RocksDB benchmark has been encountering intermittent lockups. In the failing case a thread that is taking a PMD-fault is awaiting a wakeup while holding the 'mmap_sem' for read. As soon as the next mmap() event occurs that tries to take the