Re: [PATCH v7 6/8] mm: Introduce mf_dax_kill_procs() for fsdax case

2021-10-14 Thread Darrick J. Wong
On Fri, Sep 24, 2021 at 09:09:57PM +0800, Shiyang Ruan wrote: > This function is called at the end of RMAP routine, i.e. filesystem > recovery function, to collect and kill processes using a shared page of > DAX file. The difference between mf_generic_kill_procs() is, > it accepts file's

Re: [PATCH v7 8/8] fsdax: add exception for reflinked files

2021-10-14 Thread Darrick J. Wong
On Fri, Sep 24, 2021 at 09:09:59PM +0800, Shiyang Ruan wrote: > For reflinked files, one dax page may be associated more than once with > different fime mapping and index. It will report warning. Now, since > we have introduced dax-RMAP for this case and also have to keep its > functionality for

Re: [PATCH v7 7/8] xfs: Implement ->notify_failure() for XFS

2021-10-14 Thread Darrick J. Wong
On Fri, Sep 24, 2021 at 09:09:58PM +0800, Shiyang Ruan wrote: > This function is used to handle errors which may cause data lost in > filesystem. Such as memory failure in fsdax mode. > > If the rmap feature of XFS enabled, we can query it to find files and > metadata which are associated with

Re: [PATCH v7 5/8] fsdax: Introduce dax_lock_mapping_entry()

2021-10-14 Thread Darrick J. Wong
On Fri, Sep 24, 2021 at 09:09:56PM +0800, Shiyang Ruan wrote: > The current dax_lock_page() locks dax entry by obtaining mapping and > index in page. To support 1-to-N RMAP in NVDIMM, we need a new function > to lock a specific dax entry corresponding to this file's mapping,index. > And BTW,

Re: [PATCH v7 4/8] pagemap,pmem: Introduce ->memory_failure()

2021-10-14 Thread Darrick J. Wong
On Fri, Sep 24, 2021 at 09:09:55PM +0800, Shiyang Ruan wrote: > When memory-failure occurs, we call this function which is implemented > by each kind of devices. For the fsdax case, pmem device driver > implements it. Pmem device driver will find out the filesystem in which > the corrupted page

Re: [PATCH v7 3/8] mm: factor helpers for memory_failure_dev_pagemap

2021-10-14 Thread Darrick J. Wong
On Fri, Sep 24, 2021 at 09:09:54PM +0800, Shiyang Ruan wrote: > 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 This looks like a reasonable

Re: [PATCH v7 2/8] dax: Introduce holder for dax_device

2021-10-14 Thread Darrick J. Wong
On Fri, Sep 24, 2021 at 09:09:53PM +0800, Shiyang Ruan wrote: > To easily track filesystem from a pmem device, we introduce a holder for > dax_device structure, and also its operation. This holder is used to > remember who is using this dax_device: > - When it is the backend of a filesystem, the

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

2021-10-14 Thread Dan Williams
On Thu, Oct 14, 2021 at 10:38 AM Darrick J. Wong wrote: > > On Tue, Sep 28, 2021 at 02:23:10PM +0800, Shiyang Ruan wrote: > > 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

Re: [PATCH v7 1/8] dax: Use rwsem for dax_{read,write}_lock()

2021-10-14 Thread Darrick J. Wong
On Fri, Sep 24, 2021 at 09:09:52PM +0800, Shiyang Ruan wrote: > In order to introduce dax holder registration, we need a write lock for > dax. Because of the rarity of notification failures and the infrequency > of registration events, it would be better to be a global lock rather > than

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

2021-10-14 Thread Darrick J. Wong
On Tue, Sep 28, 2021 at 02:23:10PM +0800, Shiyang Ruan wrote: > 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