Re: [PATCH] xfs: drop experimental warning for FSDAX

2024-02-27 Thread Shiyang Ruan
在 2024/2/27 0:58, Dan Williams 写道: Shiyang Ruan wrote: 在 2024/1/12 10:21, Darrick J. Wong 写道: On Thu, Jan 11, 2024 at 10:59:21AM -0600, Bill O'Donnell wrote: On Fri, Sep 15, 2023 at 02:38:54PM +0800, Shiyang Ruan wrote: FSDAX and reflink can work together now, let's drop this warning

Re: [PATCH] xfs: drop experimental warning for FSDAX

2024-02-22 Thread Shiyang Ruan
在 2024/1/12 10:21, Darrick J. Wong 写道: On Thu, Jan 11, 2024 at 10:59:21AM -0600, Bill O'Donnell wrote: On Fri, Sep 15, 2023 at 02:38:54PM +0800, Shiyang Ruan wrote: FSDAX and reflink can work together now, let's drop this warning. Signed-off-by: Shiyang Ruan Are there any updates

Re: [PATCH] fsdax: cleanup tracepoints

2024-01-18 Thread Shiyang Ruan
在 2024/1/4 20:26, Jan Kara 写道: On Thu 04-01-24 18:49:25, Shiyang Ruan wrote: Restore the tracepoint that was accidentally deleted before, and rename to dax_insert_entry(). Also, since we are using XArray, rename 'radix_entry' to 'xa_entry'. Signed-off-by: Shiyang Ruan Looks good. Feel

Re: [PATCH v12 0/2] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2024-01-11 Thread Shiyang Ruan
在 2024/1/12 6:24, Bill O'Donnell 写道: On Thu, Jun 29, 2023 at 04:16:49PM +0800, Shiyang Ruan wrote: This patchset is to add gracefully unbind support for pmem. Patch1 corrects the calculation of length and end of a given range. Patch2 introduces a new flag call MF_MEM_REMOVE, to let dax

[PATCH] fsdax: cleanup tracepoints

2024-01-04 Thread Shiyang Ruan
Restore the tracepoint that was accidentally deleted before, and rename to dax_insert_entry(). Also, since we are using XArray, rename 'radix_entry' to 'xa_entry'. Signed-off-by: Shiyang Ruan --- fs/dax.c | 2 ++ include/trace/events/fs_dax.h | 47

Re: [PATCH v15] mm, pmem, xfs: Introduce MF_MEM_PRE_REMOVE for unbind

2023-10-23 Thread Shiyang Ruan
在 2023/10/23 14:40, Chandan Babu R 写道: On Fri, Oct 20, 2023 at 08:40:09 AM -0700, Darrick J. Wong wrote: On Fri, Oct 20, 2023 at 03:26:32PM +0530, Chandan Babu R wrote: On Thu, Sep 28, 2023 at 06:32:27 PM +0800, Shiyang Ruan wrote: Changes since v14: 1. added/fixed code comments

[PATCH v15.1] mm, pmem, xfs: Introduce MF_MEM_PRE_REMOVE for unbind

2023-10-23 Thread Shiyang Ruan
orrectly. Also drop the cache of associated files before pmem is removed. [1]: https://lore.kernel.org/linux-mm/161604050314.1463742.14151665140035795571.st...@dwillia2-desk3.amr.corp.intel.com/ [2]: https://lore.kernel.org/linux-xfs/169116275623.3187159.16862410128731457358.stg-ugh@frogsfrogsfrogs

Re: [PATCH] xfs: drop experimental warning for FSDAX

2023-10-09 Thread Shiyang Ruan
在 2023/10/10 0:47, Darrick J. Wong 写道: On Mon, Oct 09, 2023 at 10:14:12PM +0800, Shiyang Ruan wrote: 在 2023/10/6 0:05, Darrick J. Wong 写道: On Thu, Oct 05, 2023 at 04:53:12PM +0800, Shiyang Ruan wrote: 在 2023/10/5 8:08, Darrick J. Wong 写道: Sorry, I sent the list below to Chandan

Re: [PATCH] xfs: drop experimental warning for FSDAX

2023-10-09 Thread Shiyang Ruan
在 2023/10/6 0:05, Darrick J. Wong 写道: On Thu, Oct 05, 2023 at 04:53:12PM +0800, Shiyang Ruan wrote: 在 2023/10/5 8:08, Darrick J. Wong 写道: Sorry, I sent the list below to Chandan, didn't cc the maillist because it's just a rough list rather than a PR: 1. subject: [v3] xfs: correct

Re: [PATCH] xfs: drop experimental warning for FSDAX

2023-10-05 Thread Shiyang Ruan
在 2023/10/5 8:08, Darrick J. Wong 写道: Sorry, I sent the list below to Chandan, didn't cc the maillist because it's just a rough list rather than a PR: 1. subject: [v3] xfs: correct calculation for agend and blockcount url:

Re: [PATCH] xfs: drop experimental warning for FSDAX

2023-10-02 Thread Shiyang Ruan
在 2023/9/30 2:34, Dan Williams 写道: Shiyang Ruan wrote: 在 2023/9/29 1:13, Darrick J. Wong 写道: On Thu, Sep 28, 2023 at 09:20:52AM -0700, Andrew Morton wrote: On Thu, 28 Sep 2023 16:44:00 +0800 Shiyang Ruan wrote: But please pick the following patch[1] as well, which fixes failures

Re: [PATCH v15] mm, pmem, xfs: Introduce MF_MEM_PRE_REMOVE for unbind

2023-10-02 Thread Shiyang Ruan
在 2023/10/1 9:43, kernel test robot 写道: Hi Shiyang, kernel test robot noticed the following build errors: url: https://github.com/intel-lab-lkp/linux/commits/UPDATE-20230928-183310/Shiyang-Ruan/xfs-fix-the-calculation-for-end-and-length/20230629-161913 base: the 2th patch of https

Re: [PATCH] xfs: drop experimental warning for FSDAX

2023-09-29 Thread Shiyang Ruan
在 2023/9/29 1:13, Darrick J. Wong 写道: On Thu, Sep 28, 2023 at 09:20:52AM -0700, Andrew Morton wrote: On Thu, 28 Sep 2023 16:44:00 +0800 Shiyang Ruan wrote: But please pick the following patch[1] as well, which fixes failures of xfs55[0-2] cases. [1] https://lore.kernel.org/linux-xfs

[PATCH v15] mm, pmem, xfs: Introduce MF_MEM_PRE_REMOVE for unbind

2023-09-28 Thread Shiyang Ruan
t progress) are handled correctly. Also drop the cache of associated files before pmem is removed. [1]: https://lore.kernel.org/linux-mm/161604050314.1463742.14151665140035795571.st...@dwillia2-desk3.amr.corp.intel.com/ [2]: https://lore.kernel.org/linux-xfs/169116275623.3187159.16862410128

Re: [PATCH] xfs: drop experimental warning for FSDAX

2023-09-28 Thread Shiyang Ruan
在 2023/9/27 23:30, Andrew Morton 写道: On Wed, 27 Sep 2023 13:01:25 +0530 Chandan Babu R wrote: 在 2023/9/27 13:17, Shiyang Ruan 写道: 在 2023/9/27 11:38, Chandan Babu R 写道: On Tue, Sep 26, 2023 at 06:46:32 PM -0700, Darrick J. Wong wrote: On Wed, Sep 27, 2023 at 11:18:42AM +1000, Dave

Re: [PATCH v14] mm, pmem, xfs: Introduce MF_MEM_PRE_REMOVE for unbind

2023-09-27 Thread Shiyang Ruan
在 2023/9/27 16:17, Dan Williams 写道: Shiyang Ruan wrote: Changes since v13: 1. don't return error if _freeze(FREEZE_HOLDER_KERNEL) got other error Now, if we suddenly remove a PMEM device(by calling unbind) which contains FSDAX while programs are still accessing data

Re: [PATCH] xfs: drop experimental warning for FSDAX

2023-09-27 Thread Shiyang Ruan
在 2023/9/27 13:17, Shiyang Ruan 写道: 在 2023/9/27 11:38, Chandan Babu R 写道: On Tue, Sep 26, 2023 at 06:46:32 PM -0700, Darrick J. Wong wrote: On Wed, Sep 27, 2023 at 11:18:42AM +1000, Dave Chinner wrote: On Tue, Sep 26, 2023 at 07:55:19AM -0700, Darrick J. Wong wrote: On Thu, Sep 21, 2023

Re: [PATCH] xfs: drop experimental warning for FSDAX

2023-09-26 Thread Shiyang Ruan
在 2023/9/27 11:38, Chandan Babu R 写道: On Tue, Sep 26, 2023 at 06:46:32 PM -0700, Darrick J. Wong wrote: On Wed, Sep 27, 2023 at 11:18:42AM +1000, Dave Chinner wrote: On Tue, Sep 26, 2023 at 07:55:19AM -0700, Darrick J. Wong wrote: On Thu, Sep 21, 2023 at 04:33:04PM +0800, Shiyang Ruan

Re: [PATCH] xfs: drop experimental warning for FSDAX

2023-09-21 Thread Shiyang Ruan
Hi, Any comments? -- Thanks, Ruan. 在 2023/9/15 14:38, Shiyang Ruan 写道: FSDAX and reflink can work together now, let's drop this warning. Signed-off-by: Shiyang Ruan --- fs/xfs/xfs_super.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index

[PATCH] xfs: drop experimental warning for FSDAX

2023-09-15 Thread Shiyang Ruan
FSDAX and reflink can work together now, let's drop this warning. Signed-off-by: Shiyang Ruan --- fs/xfs/xfs_super.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 1f77014c6e1a..faee773fa026 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs

[PATCH v14] mm, pmem, xfs: Introduce MF_MEM_PRE_REMOVE for unbind

2023-08-28 Thread Shiyang Ruan
nd processes(not only the current progress) are handled correctly. Also drop the cache of associated files before pmem is removed. [1]: https://lore.kernel.org/linux-mm/161604050314.1463742.14151665140035795571.st...@dwillia2-desk3.amr.corp.intel.com/ [2]: https://lore.kernel.org/linux-xfs/16911627

Re: [PATCH v13] mm, pmem, xfs: Introduce MF_MEM_PRE_REMOVE for unbind

2023-08-24 Thread Shiyang Ruan
在 2023/8/25 7:57, Darrick J. Wong 写道: On Thu, Aug 24, 2023 at 05:41:50PM +0800, Shiyang Ruan wrote: 在 2023/8/24 7:36, Darrick J. Wong 写道: On Wed, Aug 23, 2023 at 04:17:06PM +0800, Shiyang Ruan wrote: Changes since v12: 1. correct flag name in subject (MF_MEM_REMOVE

Re: [PATCH v13] mm, pmem, xfs: Introduce MF_MEM_PRE_REMOVE for unbind

2023-08-24 Thread Shiyang Ruan
在 2023/8/24 7:36, Darrick J. Wong 写道: On Wed, Aug 23, 2023 at 04:17:06PM +0800, Shiyang Ruan wrote: Changes since v12: 1. correct flag name in subject (MF_MEM_REMOVE => MF_MEM_PRE_REMOVE) 2. complete the behavior when fs has already frozen by kernel call NOTICE: Inst

Re: [PATCH v12 2/2] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-08-23 Thread Shiyang Ruan
在 2023/8/8 8:31, Dan Williams 写道: Shiyang Ruan wrote: This patch is inspired by Dan's "mm, dax, pmem: Introduce dev_pagemap_failure()"[1]. With the help of dax_holder and ->notify_failure() mechanism, the pmem driver is able to ask filesystem on it to unmap all files in us

[PATCH v13] mm, pmem, xfs: Introduce MF_MEM_PRE_REMOVE for unbind

2023-08-23 Thread Shiyang Ruan
4151665140035795571.st...@dwillia2-desk3.amr.corp.intel.com/ [2]: https://lore.kernel.org/linux-xfs/169116275623.3187159.16862410128731457358.stg-ugh@frogsfrogsfrogs/ Signed-off-by: Shiyang Ruan --- drivers/dax/super.c | 3 +- fs/xfs/xfs_notify_failure.c | 99 ++---

Re: [PATCH v12 2/2] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-08-03 Thread Shiyang Ruan
在 2023/8/1 11:25, Darrick J. Wong 写道: On Mon, Jul 31, 2023 at 05:36:36PM +0800, Shiyang Ruan wrote: 在 2023/7/29 23:15, Darrick J. Wong 写道: On Thu, Jun 29, 2023 at 04:16:51PM +0800, Shiyang Ruan wrote: This patch is inspired by Dan's "mm, dax, pmem: Introduce dev_pagemap_failure

Re: [PATCH v12 2/2] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-07-31 Thread Shiyang Ruan
在 2023/7/29 23:15, Darrick J. Wong 写道: On Thu, Jun 29, 2023 at 04:16:51PM +0800, Shiyang Ruan wrote: This patch is inspired by Dan's "mm, dax, pmem: Introduce dev_pagemap_failure()"[1]. With the help of dax_holder and ->notify_failure() mechanism, the pmem driver is able to a

Re: [PATCH v12 2/2] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-07-29 Thread Shiyang Ruan
在 2023/7/20 9:50, Shiyang Ruan 写道: 在 2023/7/14 22:18, Darrick J. Wong 写道: On Fri, Jul 14, 2023 at 05:07:58PM +0800, Shiyang Ruan wrote: Hi Darrick, Thanks for applying the 1st patch. Now, since this patch is based on the new freeze_super()/thaw_super() api[1], I'd like to ask what's

Re: [PATCH] nfit: remove redundant list_for_each_entry

2023-07-24 Thread Shiyang Ruan
在 2023/7/25 6:47, Alison Schofield 写道: On Wed, Jul 19, 2023 at 04:05:26PM +0800, Shiyang Ruan wrote: The first for_each only do acpi_nfit_init_ars() for NFIT_SPA_VOLATILE and NFIT_SPA_PM, which can be moved to next one. Can the result of nfit_spa_type(nfit_spa->spa) change as a res

Re: [PATCH v12 2/2] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-07-19 Thread Shiyang Ruan
在 2023/7/14 22:18, Darrick J. Wong 写道: On Fri, Jul 14, 2023 at 05:07:58PM +0800, Shiyang Ruan wrote: Hi Darrick, Thanks for applying the 1st patch. Now, since this patch is based on the new freeze_super()/thaw_super() api[1], I'd like to ask what's the plan for this api? It seems to have

[PATCH] nfit: remove redundant list_for_each_entry

2023-07-19 Thread Shiyang Ruan
The first for_each only do acpi_nfit_init_ars() for NFIT_SPA_VOLATILE and NFIT_SPA_PM, which can be moved to next one. Signed-off-by: Shiyang Ruan --- drivers/acpi/nfit/core.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index

Re: [PATCH v12 2/2] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-07-14 Thread Shiyang Ruan
.stgit@frogsfrogsfrogs/ -- Thanks, Ruan. 在 2023/6/29 16:16, Shiyang Ruan 写道: This patch is inspired by Dan's "mm, dax, pmem: Introduce dev_pagemap_failure()"[1]. With the help of dax_holder and ->notify_failure() mechanism, the pmem driver is able to ask filesystem on it to un

[PATCH v12 2/2] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-06-29 Thread Shiyang Ruan
/linux-xfs/168688010689.860947.1788875898367401950.stgit@frogsfrogsfrogs/ Signed-off-by: Shiyang Ruan --- drivers/dax/super.c | 3 +- fs/xfs/xfs_notify_failure.c | 86 ++--- include/linux/mm.h | 1 + mm/memory-failure.c | 17 ++-- 4 file

[PATCH v12 1/2] xfs: fix the calculation for "end" and "length"

2023-06-29 Thread Shiyang Ruan
The value of "end" should be "start + length - 1". Signed-off-by: Shiyang Ruan Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_notify_failure.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/xfs/xfs_notify_failure.c b/fs/xfs/xfs_notify_failure.

[PATCH v12 0/2] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-06-29 Thread Shiyang Ruan
the filesystem on the pmem gracefully. Changes since v11: Patch1: 1. correct the count calculation in xfs_failure_pgcnt(). (was a wrong fix in v11) Patch2: 1. use new exclusive freeze_super/thaw_super API, to make sure the unbind progress won't be disturbed by any other freezer. Shiyang

Re: [RFC PATCH v11.1 2/2] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-04-25 Thread Shiyang Ruan
在 2023/4/25 23:18, Darrick J. Wong 写道: On Tue, Apr 25, 2023 at 03:23:15PM +0200, Jan Kara wrote: On Tue 25-04-23 20:47:35, Shiyang Ruan wrote: 在 2023/4/20 20:09, Jan Kara 写道: On Thu 20-04-23 10:07:39, Shiyang Ruan wrote: 在 2023/4/12 18:52, Shiyang Ruan 写道: This is a RFC HOTFIX

Re: [RFC PATCH v11.1 2/2] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-04-25 Thread Shiyang Ruan
在 2023/4/20 20:09, Jan Kara 写道: On Thu 20-04-23 10:07:39, Shiyang Ruan wrote: 在 2023/4/12 18:52, Shiyang Ruan 写道: This is a RFC HOTFIX. This hotfix adds a exclusive forzen state to make sure any others won't thaw the fs during xfs_dax_notify_failure(): #define SB_FREEZE_EXCLUSIVE

Re: [RFC PATCH v11.1 2/2] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-04-19 Thread Shiyang Ruan
Ping~ 在 2023/4/12 18:52, Shiyang Ruan 写道: This is a RFC HOTFIX. This hotfix adds a exclusive forzen state to make sure any others won't thaw the fs during xfs_dax_notify_failure(): #define SB_FREEZE_EXCLUSIVE (SB_FREEZE_COMPLETE + 2) Using +2 here is because Darrick's patch[0] is using +1

[RFC PATCH v11.1 2/2] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-04-12 Thread Shiyang Ruan
ssociated files before pmem is removed. [1]: https://lore.kernel.org/linux-mm/161604050314.1463742.14151665140035795571.st...@dwillia2-desk3.amr.corp.intel.com/ Signed-off-by: Shiyang Ruan --- drivers/dax/super.c | 3 +- fs/xfs/xfs_notify_failure.c | 151

Re: [PATCH v11 2/2] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-04-06 Thread Shiyang Ruan
在 2023/4/6 22:54, Darrick J. Wong 写道: On Thu, Apr 06, 2023 at 06:50:22PM +0800, Shiyang Ruan wrote: 在 2023/4/5 1:45, Darrick J. Wong 写道: On Tue, Mar 28, 2023 at 09:41:46AM +, Shiyang Ruan wrote: This patch is inspired by Dan's "mm, dax, pmem: Introduce dev_pagemap_failure

Re: [PATCH v11 2/2] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-04-06 Thread Shiyang Ruan
在 2023/4/5 1:45, Darrick J. Wong 写道: On Tue, Mar 28, 2023 at 09:41:46AM +, Shiyang Ruan wrote: This patch is inspired by Dan's "mm, dax, pmem: Introduce dev_pagemap_failure()"[1]. With the help of dax_holder and ->notify_failure() mechanism, the pmem driver is able to a

Re: [PATCH v11 0/2] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-04-03 Thread Shiyang Ruan
Ping 在 2023/3/28 17:41, Shiyang Ruan 写道: This patchset is to add gracefully unbind support for pmem. Patch1 corrects the calculation of length and end of a given range. Patch2 introduces a new flag call MF_MEM_REMOVE, to let dax holder know it is a remove event. With the help of notify_failure

[PATCH v11 2/2] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-03-28 Thread Shiyang Ruan
is removed. [1]: https://lore.kernel.org/linux-mm/161604050314.1463742.14151665140035795571.st...@dwillia2-desk3.amr.corp.intel.com/ Signed-off-by: Shiyang Ruan --- drivers/dax/super.c | 3 +- fs/xfs/xfs_notify_failure.c | 56 + include/linux/mm.h | 1 + mm/memory-fai

[PATCH v11 0/2] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-03-28 Thread Shiyang Ruan
have to be disassociated but now the pmem is not exist. For detail analysis of this change, please refer this link[1]. [1] https://lore.kernel.org/linux-xfs/b1d9fc03-1a71-a75f-f87b-5819991e4...@fujitsu.com/ Shiyang Ruan (2): xfs: fix the calculation of length and end mm, pmem, xfs

[PATCH v11 1/2] xfs: fix the calculation of length and end

2023-03-28 Thread Shiyang Ruan
The end should be start + length - 1. Also fix the calculation of the length when seeking for intersection of notify range and device. Signed-off-by: Shiyang Ruan Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_notify_failure.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions

Re: [PATCH] fsdax: force clear dirty mark if CoW

2023-03-26 Thread Shiyang Ruan
在 2023/3/25 3:42, Andrew Morton 写道: On Fri, 24 Mar 2023 10:28:00 + Shiyang Ruan wrote: XFS allows CoW on non-shared extents to combat fragmentation[1]. The old non-shared extent could be mwrited before, its dax entry is marked dirty. To be able to delete this entry, clear its dirty

[PATCH] fsdax: force clear dirty mark if CoW

2023-03-24 Thread Shiyang Ruan
.GA11376@frogsfrogsfrogs/ Signed-off-by: Shiyang Ruan --- fs/dax.c | 37 + 1 file changed, 37 insertions(+) diff --git a/fs/dax.c b/fs/dax.c index 5d2e9b10030e..2ababb89918d 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -781,6 +781,33 @@ static int

Re: [PATCH v10 3/3] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-03-24 Thread Shiyang Ruan
在 2023/3/21 18:59, Shiyang Ruan 写道: 在 2023/2/27 18:06, Shiyang Ruan 写道: 在 2023/2/27 8:07, Dave Chinner 写道: On Fri, Feb 17, 2023 at 02:48:32PM +, Shiyang Ruan wrote: This patch is inspired by Dan's "mm, dax, pmem: Introduce dev_pagemap_failure()"[1].  With the help of

Re: [PATCH] fsdax: unshare: zero destination if srcmap is HOLE or UNWRITTEN

2023-03-23 Thread Shiyang Ruan
在 2023/3/24 12:17, Matthew Wilcox 写道: On Fri, Mar 24, 2023 at 11:42:53AM +0800, Shiyang Ruan wrote: 在 2023/3/24 11:33, Matthew Wilcox 写道: On Fri, Mar 24, 2023 at 09:50:54AM +0800, Shiyang Ruan wrote: 在 2023/3/24 6:11, Andrew Morton 写道: On Thu, 23 Mar 2023 14:50:38 +0800 Shiyang Ruan

Re: [PATCH] fsdax: dedupe should compare the min of two iters' length

2023-03-23 Thread Shiyang Ruan
在 2023/3/24 6:12, Andrew Morton 写道: On Thu, 23 Mar 2023 14:48:25 +0800 Shiyang Ruan wrote: 在 2023/3/23 7:12, Andrew Morton 写道: On Wed, 22 Mar 2023 07:25:58 + Shiyang Ruan wrote: In an dedupe corporation iter loop, the length of iomap_iter decreases because it implies

Re: [PATCH] fsdax: unshare: zero destination if srcmap is HOLE or UNWRITTEN

2023-03-23 Thread Shiyang Ruan
在 2023/3/24 11:33, Matthew Wilcox 写道: On Fri, Mar 24, 2023 at 09:50:54AM +0800, Shiyang Ruan wrote: 在 2023/3/24 6:11, Andrew Morton 写道: On Thu, 23 Mar 2023 14:50:38 +0800 Shiyang Ruan wrote: 在 2023/3/23 7:03, Andrew Morton 写道: On Wed, 22 Mar 2023 11:11:09 + Shiyang Ruan wrote

Re: [PATCH] fsdax: unshare: zero destination if srcmap is HOLE or UNWRITTEN

2023-03-23 Thread Shiyang Ruan
在 2023/3/24 6:11, Andrew Morton 写道: On Thu, 23 Mar 2023 14:50:38 +0800 Shiyang Ruan wrote: 在 2023/3/23 7:03, Andrew Morton 写道: On Wed, 22 Mar 2023 11:11:09 + Shiyang Ruan wrote: unshare copies data from source to destination. But if the source is HOLE or UNWRITTEN extents, we

Re: [PATCH] fsdax: unshare: zero destination if srcmap is HOLE or UNWRITTEN

2023-03-23 Thread Shiyang Ruan
在 2023/3/23 7:03, Andrew Morton 写道: On Wed, 22 Mar 2023 11:11:09 + Shiyang Ruan wrote: unshare copies data from source to destination. But if the source is HOLE or UNWRITTEN extents, we should zero the destination, otherwise the result will be unexpectable. Please provide much more

Re: [PATCH] fsdax: dedupe should compare the min of two iters' length

2023-03-23 Thread Shiyang Ruan
在 2023/3/23 7:12, Andrew Morton 写道: On Wed, 22 Mar 2023 07:25:58 + Shiyang Ruan wrote: In an dedupe corporation iter loop, the length of iomap_iter decreases because it implies the remaining length after each iteration. The compare function should use the min length of the current

[PATCH] fsdax: unshare: zero destination if srcmap is HOLE or UNWRITTEN

2023-03-22 Thread Shiyang Ruan
unshare copies data from source to destination. But if the source is HOLE or UNWRITTEN extents, we should zero the destination, otherwise the result will be unexpectable. Fixes: d984648e428b ("fsdax,xfs: port unshare to fsdax") Signed-off-by: Shiyang Ruan --- fs/dax.c | 11 -

[PATCH] fsdax: dedupe should compare the min of two iters' length

2023-03-22 Thread Shiyang Ruan
time") Signed-off-by: Shiyang Ruan --- fs/dax.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 3e457a16c7d1..9800b93ee14d 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -2022,8 +2022,8 @@ int dax_dedupe_file_range_compare(struct inode *src, lof

Re: [PATCH v10 3/3] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-03-21 Thread Shiyang Ruan
在 2023/2/27 18:06, Shiyang Ruan 写道: 在 2023/2/27 8:07, Dave Chinner 写道: On Fri, Feb 17, 2023 at 02:48:32PM +, Shiyang Ruan wrote: This patch is inspired by Dan's "mm, dax, pmem: Introduce dev_pagemap_failure()"[1].  With the help of dax_holder and ->notify_failure() mechan

Re: [PATCH v10 3/3] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-02-27 Thread Shiyang Ruan
在 2023/2/27 8:07, Dave Chinner 写道: On Fri, Feb 17, 2023 at 02:48:32PM +, Shiyang Ruan wrote: This patch is inspired by Dan's "mm, dax, pmem: Introduce dev_pagemap_failure()"[1]. With the help of dax_holder and ->notify_failure() mechanism, the pmem driver is able to a

Re: [PATCH v10 2/3] fs: introduce super_drop_pagecache()

2023-02-20 Thread Shiyang Ruan
在 2023/2/21 5:25, Dave Chinner 写道: On Fri, Feb 17, 2023 at 02:48:31PM +, Shiyang Ruan wrote: xfs_notify_failure.c requires a method to invalidate all dax mappings. drop_pagecache_sb() can do this but it is a static function and only build with CONFIG_SYSCTL. Now, move its implementation

Re: [PATCH v10 2/3] fs: introduce super_drop_pagecache()

2023-02-20 Thread Shiyang Ruan
在 2023/2/20 17:39, Shiyang Ruan 写道: 在 2023/2/19 2:27, Matthew Wilcox 写道: On Sat, Feb 18, 2023 at 09:16:43AM +0800, Shiyang Ruan wrote: 在 2023/2/18 0:14, Matthew Wilcox 写道: On Fri, Feb 17, 2023 at 02:48:31PM +, Shiyang Ruan wrote: -    invalidate_mapping_pages(inode->i_mapping

Re: [PATCH v10 2/3] fs: introduce super_drop_pagecache()

2023-02-20 Thread Shiyang Ruan
在 2023/2/19 2:27, Matthew Wilcox 写道: On Sat, Feb 18, 2023 at 09:16:43AM +0800, Shiyang Ruan wrote: 在 2023/2/18 0:14, Matthew Wilcox 写道: On Fri, Feb 17, 2023 at 02:48:31PM +, Shiyang Ruan wrote: - invalidate_mapping_pages(inode->i_mapping, 0, -1); - i

Re: [PATCH v10 2/3] fs: introduce super_drop_pagecache()

2023-02-17 Thread Shiyang Ruan
在 2023/2/18 0:14, Matthew Wilcox 写道: On Fri, Feb 17, 2023 at 02:48:31PM +, Shiyang Ruan wrote: - invalidate_mapping_pages(inode->i_mapping, 0, -1); - iput(toput_inode); - toput_inode = inode; - - cond_resc

[PATCH v10 2/3] fs: introduce super_drop_pagecache()

2023-02-17 Thread Shiyang Ruan
can choose which invalidate method to use. Signed-off-by: Shiyang Ruan --- fs/drop_caches.c| 29 +-- fs/super.c | 43 + include/linux/fs.h | 2 ++ include/linux/pagemap.h | 1 + mm/truncate.c | 20

[PATCH v10 3/3] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-02-17 Thread Shiyang Ruan
5140035795571.st...@dwillia2-desk3.amr.corp.intel.com/ Signed-off-by: Shiyang Ruan --- drivers/dax/super.c | 3 ++- fs/xfs/xfs_notify_failure.c | 26 ++ include/linux/mm.h | 1 + 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/drivers/dax/s

[PATCH v10 1/3] xfs: fix the calculation of length and end

2023-02-17 Thread Shiyang Ruan
The end should be start + length - 1. Also fix the calculation of the length when seeking for intersection of notify range and device. Signed-off-by: Shiyang Ruan Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_notify_failure.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff

[PATCH v10 0/3] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2023-02-17 Thread Shiyang Ruan
ore invalidate dax mapping Shiyang Ruan (3): xfs: fix the calculation of length and end fs: introduce super_drop_pagecache() mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind drivers/dax/super.c | 3 ++- fs/drop_caches.c| 29 + fs/supe

[PATCH v2] fsdax: dax_unshare_iter() should return a valid length

2023-02-02 Thread Shiyang Ruan
The copy_mc_to_kernel() will return 0 if it executed successfully. Then the return value should be set to the length it copied. Fixes: d984648e428b ("fsdax,xfs: port unshare to fsdax") Signed-off-by: Shiyang Ruan --- fs/dax.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletion

[PATCH] fsdax: dax_unshare_iter() should return a valid length

2023-02-02 Thread Shiyang Ruan
The copy_mc_to_kernel() will return 0 if it executed successfully. Then the return value should be set to the length it copied. Fixes: d984648e428b ("fsdax,xfs: port unshare to fsdax") Signed-off-by: Shiyang Ruan --- fs/dax.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/

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

2021-08-16 Thread Shiyang Ruan
to copy the head and tail ranges which is outside of the non-aligned area instead of copying the whole aligned range. But in dax page fault, it will always be an aligned range. So, we have to copy the whole range in this case. Signed-off-by: Shiyang Ruan Reviewed-by: Christoph Hellwig Reviewed

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

2021-08-16 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 --- fs/dax.c | 16

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

2021-08-16 Thread Shiyang Ruan
ax, we are able to make reflink and fsdax work together in XFS. (Rebased on v5.14-rc4 and Christoph's "switch iomap to an iterator model v2"[1]) [1]: https://lore.kernel.org/linux-xfs/20210809061244.1196573-1-...@lst.de/ == Shiyang Ruan (8): fsdax: Output address in dax_iomap_pfn() and r

[PATCH v7 8/8] fs/xfs: Add dax dedupe support

2021-08-16 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 --- fs/xfs/xfs_file.c| 2 +- fs/xfs/xfs_inode.c | 57

[PATCH v7 7/8] fsdax: Introduce dax_iomap_ops for end of reflink

2021-08-16 Thread Shiyang Ruan
iginal struct iomap_ops and fsdax specific ->actor_end(), which is for the end operations of reflink - also introduce dax specific zero_range, truncate_page - create new dax_iomap_ops for ext2 and ext4 Signed-off-by: Shiyang Ruan --- fs/dax.c

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

2021-08-16 Thread Shiyang Ruan
-by: Shiyang Ruan Reviewed-by: Christoph Hellwig Reviewed-by: Ritesh Harjani Reviewed-by: Darrick J. Wong --- fs/dax.c | 39 --- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 697a7b7bb96f..e49ba68cc7e4 100644 --- a/fs

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

2021-08-16 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 v7 5/8] iomap: Introduce iomap_iter2 for two files

2021-08-16 Thread Shiyang Ruan
Some operations, such as comparing a range of data in two files under fsdax mode, requires nested iomap_begin()/iomap_end() on two files. Thus, we introduce iomap_iter2() to accept two iteraters to operate action on two files. Signed-off-by: Shiyang Ruan --- fs/iomap/core.c | 51

[PATCH v7 4/8] fsdax: Add dax_iomap_cow_copy() for dax_iomap_zero

2021-08-16 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 srcmap to dax_iomap_zero() and replace memset() as dax_iomap_cow_copy(). Signed-off-by: Shiyang Ruan Reviewed-by: Ritesh Harjani Reviewed-by: Darrick J. Wong

[PATCH RESEND v6 7/9] dm: Introduce ->rmap() to find bdev offset

2021-07-30 Thread Shiyang Ruan
will be supported in the future. However, some targets may not support it because of the non-linear mapping. Signed-off-by: Shiyang Ruan --- block/genhd.c | 56 +++ drivers/md/dm-linear.c| 20 + include/linux/device-mapper.h | 5 include

[PATCH RESEND v6 8/9] md: Implement dax_holder_operations

2021-07-30 Thread Shiyang Ruan
. When it is done, call dax_corrupted_range() for the holder of this mapped device. Signed-off-by: Shiyang Ruan --- drivers/md/dm.c | 126 +++- 1 file changed, 125 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index

[PATCH RESEND v6 6/9] xfs: Implement ->notify_failure() for XFS

2021-07-30 Thread Shiyang Ruan
mapped into their address spaces, but future patches could actually do something about corrupt metadata. After that, the memory failure needs to notify the processes who are using those files. Signed-off-by: Shiyang Ruan --- drivers/dax/super.c | 12 fs/xfs/xfs_fsops.c | 5 ++ fs/xfs

[PATCH RESEND v6 9/9] fsdax: add exception for reflinked files

2021-07-30 Thread Shiyang Ruan
. Signed-off-by: Shiyang Ruan --- fs/dax.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index dce6307a12eb..f5910d178695 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -352,9 +352,10 @@ static void dax_associate_entry(void *entry, struct

[PATCH RESEND v6 5/9] mm: Introduce mf_dax_kill_procs() for fsdax case

2021-07-30 Thread Shiyang Ruan
in fsdax mode. So, it is called when filesystem RMAP results are found. Signed-off-by: Shiyang Ruan --- fs/dax.c| 45 --- include/linux/dax.h | 16 include/linux/mm.h | 10 +++ mm/memory-failure.c | 64

[PATCH RESEND v6 1/9] pagemap: Introduce ->memory_failure()

2021-07-30 Thread Shiyang Ruan
with this error. The filesystem will try to recover the corrupted data if necessary. Signed-off-by: Shiyang Ruan --- include/linux/memremap.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/linux/memremap.h b/include/linux/memremap.h index c0e9d35889e8..ed6980087db5 100644 --- a/include

[PATCH RESEND v6 3/9] mm: factor helpers for memory_failure_dev_pagemap

2021-07-30 Thread Shiyang Ruan
memory_failure_dev_pagemap code is a bit complex before introduce RMAP feature for fsdax. So it is needed to factor some helper functions to simplify these code. Signed-off-by: Shiyang Ruan --- mm/memory-failure.c | 101 +--- 1 file changed, 57

[PATCH RESEND v6 2/9] dax: Introduce holder for dax_device

2021-07-30 Thread Shiyang Ruan
filesystem is being mounted, or an target device is being activated. Signed-off-by: Shiyang Ruan --- drivers/dax/super.c | 46 + include/linux/dax.h | 17 + 2 files changed, 63 insertions(+) diff --git a/drivers/dax/super.c b/drivers/dax

[PATCH RESEND v6 0/9] fsdax: introduce fs query to support reflink

2021-07-30 Thread Shiyang Ruan
|* md_dax_notify_failure() | |- | md_targets->iterate_devices() | md_targets->rmap() => linear_rmap() | dax_holder_notify_failure() |* normal case |- mf_generic_kill_procs() The fsdax & reflink support for XFS is not contained in this patchset. (Rebased on v5.14

[PATCH v6 9/9] fsdax: add exception for reflinked files

2021-07-30 Thread Shiyang Ruan
. Signed-off-by: Shiyang Ruan --- fs/dax.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index dce6307a12eb..f5910d178695 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -352,9 +352,10 @@ static void dax_associate_entry(void *entry, struct

[PATCH v6 8/9] md: Implement dax_holder_operations

2021-07-30 Thread Shiyang Ruan
. When it is done, call dax_corrupted_range() for the holder of this mapped device. Signed-off-by: Shiyang Ruan --- drivers/md/dm.c | 126 +++- 1 file changed, 125 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index

[PATCH v6 6/9] xfs: Implement ->corrupted_range() for XFS

2021-07-30 Thread Shiyang Ruan
mapped into their address spaces, but future patches could actually do something about corrupt metadata. After that, the memory failure needs to notify the processes who are using those files. Signed-off-by: Shiyang Ruan --- drivers/dax/super.c | 12 fs/xfs/xfs_fsops.c | 5 ++ fs/xfs

[PATCH v6 5/9] mm: Introduce mf_dax_kill_procs() for fsdax case

2021-07-30 Thread Shiyang Ruan
in fsdax mode. So, it is called when filesystem RMAP results are found. Signed-off-by: Shiyang Ruan --- fs/dax.c| 45 --- include/linux/dax.h | 16 include/linux/mm.h | 10 +++ mm/memory-failure.c | 64

[PATCH v6 4/9] pmem,mm: Implement ->memory_failure in pmem driver

2021-07-30 Thread Shiyang Ruan
With dax_holder notify support, we are able to notify the memory failure from pmem driver to upper layers. If there is something not support in the notify routine, memory_failure will fall back to the generic hanlder. Signed-off-by: Shiyang Ruan --- drivers/nvdimm/pmem.c | 13 + mm

[PATCH v6 2/9] dax: Introduce holder for dax_device

2021-07-30 Thread Shiyang Ruan
filesystem is being mounted, or an target device is being activated. Signed-off-by: Shiyang Ruan --- drivers/dax/super.c | 46 + include/linux/dax.h | 17 + 2 files changed, 63 insertions(+) diff --git a/drivers/dax/super.c b/drivers/dax

[PATCH v6 1/9] pagemap: Introduce ->memory_failure()

2021-07-30 Thread Shiyang Ruan
with this error. The filesystem will try to recover the corrupted data if necessary. Signed-off-by: Shiyang Ruan --- include/linux/memremap.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/linux/memremap.h b/include/linux/memremap.h index c0e9d35889e8..ed6980087db5 100644 --- a/include

[PATCH v6.2 6/7] dax: Introduce dax_iomap_ops for end of reflink

2021-07-09 Thread Shiyang Ruan
ntains the original struct iomap_ops and fsdax specific ->actor_end(), which is for the end operations of reflink - also introduce dax specific zero_range, truncate_page - create new dax_iomap_ops for ext2 and ext4 Then enable fsdax and reflink together in xfs. Signed-off-by: Shiyang Ruan ---

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

2021-07-02 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: Darrick J. Wong

[RESEND PATCH v3 2/3] fsdax: Factor helper: dax_fault_actor()

2021-07-02 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 Reviewed-by: Christoph

[RESEND PATCH v3 1/3] fsdax: Factor helpers to simplify dax fault code

2021-07-02 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

[RESEND PATCH v3 0/3] fsdax: Factor helper functions to simplify the code

2021-07-02 Thread Shiyang Ruan
- simplify return logic in dax_fault_cow_page() (Rebased on v5.13) == Shiyang Ruan (3): fsdax: Factor helpers to simplify dax fault code fsdax: Factor helper: dax_fault_actor() fsdax: Output address in dax_iomap_pfn() and rename it fs/d

[PATCH v5 9/9] fs/dax: Remove useless functions

2021-06-27 Thread Shiyang Ruan
Since owner tracking is triggerred by pmem device, these functions are useless. So remove them. Signed-off-by: Shiyang Ruan --- fs/dax.c | 46 -- 1 file changed, 46 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 7c5d8acd6bc5..cee8e61d1025

[PATCH v5 8/9] md: Implement dax_holder_operations

2021-06-27 Thread Shiyang Ruan
. When it is done, call dax_corrupted_range() for the holder of this mapped device. Signed-off-by: Shiyang Ruan --- drivers/md/dm.c | 126 +++- 1 file changed, 125 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index

  1   2   >