[PATCH v5 4/4] docs: ABI: sysfs-bus-nvdimm: Document sysfs event format entries for nvdimm pmu

2021-09-28 Thread Kajol Jain
Details are added for the event, cpumask and format attributes in the ABI documentation. Signed-off-by: Kajol Jain --- Documentation/ABI/testing/sysfs-bus-nvdimm | 35 ++ 1 file changed, 35 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-nvdimm

[PATCH v5 3/4] powerpc/papr_scm: Add perf interface support

2021-09-28 Thread Kajol Jain
Performance monitoring support for papr-scm nvdimm devices via perf interface is added which includes addition of pmu functions like add/del/read/event_init for nvdimm_pmu struture. A new parameter 'priv' in added to the pdev_archdata structure to save nvdimm_pmu device pointer, to handle the

[PATCH v5 2/4] drivers/nvdimm: Add perf interface to expose nvdimm performance stats

2021-09-28 Thread Kajol Jain
A common interface is added to get performance stats reporting support for nvdimm devices. Added interface defines supported event list, config fields for the event attributes and their corresponding bit values which are exported via sysfs. Interface also added support for pmu register/unregister

[PATCH v5 1/4] drivers/nvdimm: Add nvdimm pmu structure

2021-09-28 Thread Kajol Jain
A structure is added called nvdimm_pmu, for performance stats reporting support of nvdimm devices. It can be used to add device pmu data such as pmu data structure for performance stats, nvdimm device pointer along with cpumask attributes. Signed-off-by: Kajol Jain --- include/linux/nd.h | 20

[PATCH v5 0/4] Add perf interface to expose nvdimm

2021-09-28 Thread Kajol Jain
Patchset adds performance stats reporting support for nvdimm. Added interface includes support for pmu register/unregister functions. A structure is added called nvdimm_pmu to be used for adding arch/platform specific data such as cpumask, nvdimm device pointer and pmu event functions like

[PATCH v10 3/8] fsdax: Replace mmap entry in case of CoW

2021-09-28 Thread Shiyang Ruan
Replace the existing entry to the newly allocated one in case of CoW. Also, we mark the entry as PAGECACHE_TAG_TOWRITE so writeback marks this entry as writeprotected. This helps us snapshots so new write pagefaults after snapshots trigger a CoW. Signed-off-by: Goldwyn Rodrigues Signed-off-by:

[PATCH v10 2/8] fsdax: Introduce dax_iomap_cow_copy()

2021-09-28 Thread Shiyang Ruan
In the case where the iomap is a write operation and iomap is not equal to srcmap after iomap_begin, we consider it is a CoW operation. In this case, the destination (iomap->addr) points to a newly allocated extent. It is needed to copy the data from srcmap to the extent. In theory, it is

[PATCH v10 0/8] fsdax,xfs: Add reflink support for fsdax

2021-09-28 Thread Shiyang Ruan
This patchset is attempt to add CoW support for fsdax, and take XFS, which has both reflink and fsdax feature, as an example. Changes from V9: - Rebased on v5.15-rc3 - Patch 3: Fix build error when CONFIG_FS_DAX_PMD not set - Patch 4: Add 'const' prefix for iomap_iter - Patch 7: Introduce

[PATCH v10 1/8] fsdax: Output address in dax_iomap_pfn() and rename it

2021-09-28 Thread Shiyang Ruan
Add address output in dax_iomap_pfn() in order to perform a memcpy() in CoW case. Since this function both output address and pfn, rename it to dax_iomap_direct_access(). Signed-off-by: Shiyang Ruan Reviewed-by: Christoph Hellwig Reviewed-by: Ritesh Harjani Reviewed-by: Dan Williams

[PATCH v10 6/8] fsdax: Dedup file range to use a compare function

2021-09-28 Thread Shiyang Ruan
With dax we cannot deal with readpage() etc. So, we create a dax comparison function which is similar with vfs_dedupe_file_range_compare(). And introduce dax_remap_file_range_prep() for filesystem use. Signed-off-by: Goldwyn Rodrigues Signed-off-by: Shiyang Ruan Reviewed-by: Darrick J. Wong

[PATCH v10 7/8] xfs: support CoW in fsdax mode

2021-09-28 Thread Shiyang Ruan
In fsdax mode, WRITE and ZERO on a shared extent need CoW performed. After that, new allocated extents needs to be remapped to the file. So, add a CoW identification in ->iomap_begin(), and implement ->iomap_end() to do the remapping work. Signed-off-by: Shiyang Ruan --- fs/xfs/xfs_bmap_util.c

[PATCH v10 8/8] xfs: Add dax dedupe support

2021-09-28 Thread Shiyang Ruan
Introduce xfs_mmaplock_two_inodes_and_break_dax_layout() for dax files who are going to be deduped. After that, call compare range function only when files are both DAX or not. Signed-off-by: Shiyang Ruan Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_file.c|

[PATCH v10 4/8] fsdax: Convert dax_iomap_zero to iter model

2021-09-28 Thread Shiyang Ruan
Let dax_iomap_zero() support iter model. Signed-off-by: Shiyang Ruan Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/dax.c | 3 ++- fs/iomap/buffered-io.c | 3 +-- include/linux/dax.h| 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git

[PATCH v10 5/8] fsdax: Add dax_iomap_cow_copy() for dax_iomap_zero

2021-09-28 Thread Shiyang Ruan
Punch hole on a reflinked file needs dax_iomap_cow_copy() too. Otherwise, data in not aligned area will be not correct. So, add the CoW operation for not aligned case in dax_iomap_zero(). Signed-off-by: Shiyang Ruan Reviewed-by: Ritesh Harjani Reviewed-by: Darrick J. Wong Reviewed-by: