Re: [ndctl PATCH v3 1/4] libndctl: test enablement for non-nfit devices

2021-03-18 Thread Santosh Sivaraj
"Verma, Vishal L" writes: Hi Vishal, > On Thu, 2021-03-11 at 13:16 +0530, Santosh Sivaraj wrote: >> Unify adding dimms for papr and nfit families, this will help in adding > > Minor nit, but it seems like the subject line and the first sentence in > the body should be swapped. The one-line descr

Re: [ndctl PATCH v3 2/4] test: Don't skip tests if nfit modules are missing

2021-03-18 Thread Santosh Sivaraj
"Verma, Vishal L" writes: > On Thu, 2021-03-11 at 13:16 +0530, Santosh Sivaraj wrote: >> For NFIT to be available ACPI is a must, so don't fail when nfit modules >> are missing on a platform that doesn't support ACPI. >> >> Signed-off-by: Santosh Sivaraj >> --- >>  test.h

RE: [PATCH v3 01/11] pagemap: Introduce ->memory_failure()

2021-03-18 Thread ruansy.f...@fujitsu.com
> -Original Message- > From: ruansy.f...@fujitsu.com > Subject: RE: [PATCH v3 01/11] pagemap: Introduce ->memory_failure() > > > > > > > > > > > > After the conversation with Dave I don't see the point of this. > > > > > > If there is a memory_failure() on a page, why not just call > >

[PATCH v3 10/10] fs/xfs: Add dedupe support for fsdax

2021-03-18 Thread Shiyang Ruan
Add xfs_break_two_dax_layouts() to break layout for tow dax files. Then call compare range function only when files are both DAX or not. Signed-off-by: Shiyang Ruan --- fs/xfs/xfs_file.c| 20 fs/xfs/xfs_inode.c | 8 +++- fs/xfs/xfs_inode.h | 1 + fs/xfs/xfs_re

[PATCH v3 09/10] fs/xfs: Handle CoW for fsdax write() path

2021-03-18 Thread Shiyang Ruan
In fsdax mode, WRITE and ZERO on a shared extent need CoW performed. After CoW, new allocated extents needs to be remapped to the file. So, add an iomap_end for dax write ops to do the remapping work. Signed-off-by: Shiyang Ruan --- fs/xfs/xfs_bmap_util.c | 3 +-- fs/xfs/xfs_file.c | 9 +

[PATCH v3 08/10] fsdax: Dedup file range to use a compare function

2021-03-18 Thread Shiyang Ruan
With dax we cannot deal with readpage() etc. So, we create a dax comparison funciton 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 --- fs/dax.c | 56 ++

[PATCH v3 07/10] iomap: Introduce iomap_apply2() for operations on two files

2021-03-18 Thread Shiyang Ruan
Some operations, such as comparing a range of data in two files under fsdax mode, requires nested iomap_open()/iomap_end() on two file. Thus, we introduce iomap_apply2() to accept arguments from two files and iomap_actor2_t for actions on two files. Signed-off-by: Shiyang Ruan --- fs/iomap/appl

[PATCH v3 05/10] fsdax: Replace mmap entry in case of CoW

2021-03-18 Thread Shiyang Ruan
We 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 v3 06/10] fsdax: Add dax_iomap_cow_copy() for dax_iomap_zero

2021-03-18 Thread Shiyang Ruan
Punch hole on a reflinked file needs dax_copy_edge() too. Otherwise, data in not aligned area will be not correct. So, add the srcmap to dax_iomap_zero() and replace memset() as dax_copy_edge(). Signed-off-by: Shiyang Ruan --- fs/dax.c | 9 +++-- fs/iomap/buffered-io.c | 2 +-

[PATCH v3 04/10] fsdax: Introduce dax_iomap_cow_copy()

2021-03-18 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. The destance extent which iomap indicated is new allocated extent. So, it is needed to copy the data from srcmap to new allocated extent. In theory, it is better

[PATCH v3 03/10] fsdax: Output address in dax_iomap_pfn() and rename it

2021-03-18 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 --- fs/dax.c | 16 1 file changed, 12 insertion

[PATCH v3 02/10] fsdax: Factor helper: dax_fault_actor()

2021-03-18 Thread Shiyang Ruan
The core logic in the two dax page fault functions is similar. So, move the logic into a common helper function. Also, to facilitate the addition of new features, such as CoW, switch-case is no longer used to handle different iomap types. Signed-off-by: Shiyang Ruan --- fs/dax.c | 291 ++

[PATCH v3 00/10] fsdax,xfs: Add reflink&dedupe support for fsdax

2021-03-18 Thread Shiyang Ruan
From: 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 V2: - Fix the mistake in iomap_apply2() and dax_dedupe_file_range_compare() - Add CoW judgement in dax_iomap_zero() - Fix other code st

[PATCH v3 01/10] fsdax: Factor helpers to simplify dax fault code

2021-03-18 Thread Shiyang Ruan
The dax page fault code is too long and a bit difficult to read. And it is hard to understand when we trying to add new features. Some of the PTE/PMD codes have similar logic. So, factor them as helper functions to simplify the code. Signed-off-by: Shiyang Ruan Reviewed-by: Christoph Hellwig ---

Re: [PATCH 2/3] mm, dax, pmem: Introduce dev_pagemap_failure()

2021-03-18 Thread Dan Williams
On Wed, Mar 17, 2021 at 9:45 PM Darrick J. Wong wrote: > > On Wed, Mar 17, 2021 at 09:08:23PM -0700, Dan Williams wrote: > > Jason wondered why the get_user_pages_fast() path takes references on a > > @pgmap object. The rationale was to protect against accessing a 'struct > > page' that might be i

Re: [PATCH 2/3] mm, dax, pmem: Introduce dev_pagemap_failure()

2021-03-18 Thread Dan Williams
On Wed, Mar 17, 2021 at 9:58 PM Dave Chinner wrote: > > On Wed, Mar 17, 2021 at 09:08:23PM -0700, Dan Williams wrote: > > Jason wondered why the get_user_pages_fast() path takes references on a > > @pgmap object. The rationale was to protect against accessing a 'struct > > page' that might be in t

Re: [PATCH 3/3] mm/devmap: Remove pgmap accounting in the get_user_pages_fast() path

2021-03-18 Thread Dan Williams
On Thu, Mar 18, 2021 at 3:02 AM Joao Martins wrote: > > On 3/18/21 4:08 AM, Dan Williams wrote: > > Now that device-dax and filesystem-dax are guaranteed to unmap all user > > mappings of devmap / DAX pages before tearing down the 'struct page' > > array, get_user_pages_fast() can rely on its trad

Re: [PATCH 3/3] mm/devmap: Remove pgmap accounting in the get_user_pages_fast() path

2021-03-18 Thread Joao Martins
On 3/18/21 4:08 AM, Dan Williams wrote: > Now that device-dax and filesystem-dax are guaranteed to unmap all user > mappings of devmap / DAX pages before tearing down the 'struct page' > array, get_user_pages_fast() can rely on its traditional synchronization > method "validate_pte(); get_page(); r