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

2021-12-14 Thread Dan Williams
On Thu, Dec 2, 2021 at 12:49 AM 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 holder

Re: [PATCH v8 7/9] dax: add dax holder helper for filesystems

2021-12-14 Thread Shiyang Ruan
在 2021/12/14 23:47, Christoph Hellwig 写道: On Thu, Dec 02, 2021 at 04:48:54PM +0800, Shiyang Ruan wrote: Add these helper functions, and export them for filesystem use. What is the point of adding these wrappers vs just calling the underlying functions? I added them so that they can be

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

2021-12-14 Thread Shiyang Ruan
在 2021/12/14 23:40, Christoph Hellwig 写道: On Thu, Dec 02, 2021 at 04:48:48PM +0800, Shiyang Ruan wrote: In order to introduce dax holder registration, we need a write lock for dax. Change the current lock to percpu_rw_semaphore and introduce a write lock for registration. Why do we need

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

2021-12-14 Thread Darrick J. Wong
On Thu, Dec 02, 2021 at 04:48:55PM +0800, Shiyang Ruan wrote: > Introduce xfs_notify_failure.c to handle failure related works, such as > implement ->notify_failure(), register/unregister dax holder in xfs, and > so on. > > If the rmap feature of XFS enabled, we can query it to find files and >

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

2021-12-14 Thread Christoph Hellwig
> + // TODO check and try to fix metadata Please avoid //-style comments. > +static u64 > +xfs_dax_ddev_offset( > + struct xfs_mount*mp, > + struct dax_device *dax_dev, > + u64 disk_offset) > +{ > + xfs_buftarg_t *targp; > + > +

Re: [PATCH v8 7/9] dax: add dax holder helper for filesystems

2021-12-14 Thread Christoph Hellwig
On Thu, Dec 02, 2021 at 04:48:54PM +0800, Shiyang Ruan wrote: > Add these helper functions, and export them for filesystem use. What is the point of adding these wrappers vs just calling the underlying functions?

Re: [PATCH v8 6/9] mm: Introduce mf_dax_kill_procs() for fsdax case

2021-12-14 Thread Christoph Hellwig
On Thu, Dec 02, 2021 at 04:48:53PM +0800, Shiyang Ruan wrote: > @@ -254,6 +254,15 @@ static inline bool dax_mapping(struct address_space > *mapping) > { > return mapping->host && IS_DAX(mapping->host); > } > +static inline unsigned long pgoff_address(pgoff_t pgoff, > + struct

Re: [PATCH v8 5/9] fsdax: Introduce dax_lock_mapping_entry()

2021-12-14 Thread Christoph Hellwig
On Thu, Dec 02, 2021 at 04:48:52PM +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 v8 1/9] dax: Use percpu rwsem for dax_{read,write}_lock()

2021-12-14 Thread Christoph Hellwig
On Thu, Dec 02, 2021 at 04:48:48PM +0800, Shiyang Ruan wrote: > In order to introduce dax holder registration, we need a write lock for > dax. Change the current lock to percpu_rw_semaphore and introduce a > write lock for registration. Why do we need to change the existing, global locking for