Re: [PATCH v3 4/6] mm: pvmw: add support for walking devmap pages

2022-02-28 Thread Muchun Song
On Tue, Mar 1, 2022 at 5:26 AM Andrew Morton wrote: > > On Mon, 28 Feb 2022 14:35:34 +0800 Muchun Song > wrote: > > > The devmap pages can not use page_vma_mapped_walk() to check if a huge > > devmap page is mapped into a vma. Add support for walking huge devmap > > pages so that DAX can use

[PATCH 09/11] libnvdimm: Drop nd_device_lock()

2022-02-28 Thread Dan Williams
In preparation for switching to the core device_lock lockdep validation scheme, convert nd_device_lock() calls back to device_lock(). Cc: Vishal Verma Cc: Dave Jiang Cc: Ira Weiny Signed-off-by: Dan Williams --- drivers/nvdimm/btt_devs.c | 16 drivers/nvdimm/bus.c

[PATCH 11/11] device-core: Introduce a per-subsystem lockdep_mutex

2022-02-28 Thread Dan Williams
In order for multiple subsystems to convey their device_lock ordering constraints, each needs their own exclusive mutex. Rather than select a subsystem to validate at compile-time, allow for simultaneous validation of multiple subsystems. Note that the reason the mutex_init() for the various

[PATCH 10/11] libnvdimm: Enable lockdep validation

2022-02-28 Thread Dan Williams
Register libnvdimm subsystem devices with a non-zero lock_class to enable the device-core to track lock dependencies. Cc: Vishal Verma Cc: Dave Jiang Cc: Ira Weiny Signed-off-by: Dan Williams --- drivers/nvdimm/bus.c |3 +++ drivers/nvdimm/nd-core.h |9 + 2 files changed,

[PATCH 08/11] ACPI: NFIT: Drop nfit_device_lock()

2022-02-28 Thread Dan Williams
In preparation for the libnvdimm subsystem switching to device-core common lockdep validation. Delete nfit_device_lock() which will need to be replaced with an implementation that specifies a non-zero lock class. Cc: Vishal Verma Cc: Dave Jiang Cc: Ira Weiny Cc: "Rafael J. Wysocki"

[PATCH 07/11] libnvdimm: Refactor an nvdimm_lock_class() helper

2022-02-28 Thread Dan Williams
In preparation for moving to the device-core device_lock lockdep validation, refactor an nvdimm_lock_class() helper to be used with device_set_lock_class(). Cc: Vishal Verma Cc: Dave Jiang Cc: Ira Weiny Signed-off-by: Dan Williams --- drivers/nvdimm/nd-core.h | 21 + 1

[PATCH 06/11] cxl/acpi: Add a lock class for the root platform device

2022-02-28 Thread Dan Williams
Now that the device-core can start validating lockdep usage after the device has been added, use that capability to validate usage of device_lock() against the ACPI0017 device relative to other subsystem locks. Cc: Alison Schofield Cc: Vishal Verma Cc: Ira Weiny Cc: Ben Widawsky

[PATCH 05/11] cxl/core: Introduce cxl_set_lock_class()

2022-02-28 Thread Dan Williams
Update CONFIG_PROVE_CXL_LOCKING to use the common device-core helpers for device_lock validation. When CONFIG_PROVE_LOCKING is enabled and device_set_lock_class() is passed a non-zero lock class the core acquires the 'struct device' @lockdep_mutex everywhere it acquires the device_lock. Where

[PATCH 04/11] cxl/core: Clamp max lock_class

2022-02-28 Thread Dan Williams
MAX_LOCKDEP_SUBCLASSES limits the depth of the CXL topology that can be validated by lockdep. Given that the cxl_test topology is already at this limit collapse some of the levels and clamp the max depth. Cc: Alison Schofield Cc: Vishal Verma Cc: Ira Weiny Cc: Ben Widawsky Signed-off-by: Dan

[PATCH 03/11] cxl/core: Remove cxl_device_lock()

2022-02-28 Thread Dan Williams
In preparation for moving lockdep_mutex nested lock acquisition into the core, remove the cxl_device_lock() wrapper, but preserve cxl_lock_class() that will be used to inform the core of the subsystem's lock ordering rules. Cc: Alison Schofield Cc: Vishal Verma Cc: Ira Weiny Cc: Ben Widawsky

[PATCH 02/11] cxl/core: Refactor a cxl_lock_class() out of cxl_nested_lock()

2022-02-28 Thread Dan Williams
In preparation for upleveling device_lock() lockdep annotation support into the core, provide a helper to retrieve the lock class. This lock_class will be used with device_set_lock_class() to idenify the CXL nested locking rules. Cc: Alison Schofield Cc: Vishal Verma Cc: Ira Weiny Cc: Ben

[PATCH 01/11] device-core: Enable lockdep validation

2022-02-28 Thread Dan Williams
The @lockdep_mutex attribute of 'struct device' was introduced to allow subsystems to wrap their usage of device_lock() with a local definition that adds nested annotations and lockdep validation. However, that approach leaves lockdep blind to the device_lock usage in the device-core. Instead of

[PATCH 00/11] device-core: Generic device-lock lockdep validation

2022-02-28 Thread Dan Williams
Greg, Rafael, Here are some extensions to the 'lockdep_mutex' I came up with after getting tired of alternating debug builds between CXL and NVDIMM subsystem testing, and worrying about the missing lockdep coverage from device-lock acquisition in the device-core. The primary insight is that the

Re: [PATCH v3 4/6] mm: pvmw: add support for walking devmap pages

2022-02-28 Thread Andrew Morton
On Mon, 28 Feb 2022 14:35:34 +0800 Muchun Song wrote: > The devmap pages can not use page_vma_mapped_walk() to check if a huge > devmap page is mapped into a vma. Add support for walking huge devmap > pages so that DAX can use it in the next patch. > x86_64 allnoconfig: In file included from

Re: [PATCH v1] device-dax: Adding match parameter to select which driver to match dax devices

2022-02-28 Thread kernel test robot
in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Zhenguo-Yao/device-dax-Adding-match-parameter-to-select-which-driver-to-match-dax-devices/20220228-175040 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

Re: [PATCH v3 4/6] mm: pvmw: add support for walking devmap pages

2022-02-28 Thread kernel test robot
to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Muchun-Song/Fix-some-bugs-related-to-ramp-and-dax/20220228-143753 base: https://github.com/hnaz/linux-mm master config: riscv-randconfig-r012-20220227 (https://download

[PATCH v1] device-dax: Adding match parameter to select which driver to match dax devices

2022-02-28 Thread Zhenguo Yao
device_dax driver always match dax devices by default. The other drivers only match devices by dax_id. There are situations which need kmem drvier match all the dax device at boot time. So adding a parameter to support this function. Signed-off-by: Zhenguo Yao --- drivers/dax/device.c | 3 +++