[PATCH v12 6/7] xfs: Implement ->notify_failure() for XFS

2022-04-10 Thread Shiyang Ruan
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 metadata which are associated with the corrupt data. For now all we do is

[PATCH v12 5/7] mm: Introduce mf_dax_kill_procs() for fsdax case

2022-04-10 Thread Shiyang Ruan
This new function is a variant of mf_generic_kill_procs that accepts a file, offset pair instead o a struct to support multiple files sharing a DAX mapping. It is intended to be called by the file systems as part of the memory_failure handler after the file system performed a reverse mapping from

[PATCH v12 4/7] fsdax: Introduce dax_lock_mapping_entry()

2022-04-10 Thread Shiyang Ruan
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 output the page corresponding to the specific dax entry for caller use.

[PATCH v12 3/7] pagemap,pmem: Introduce ->memory_failure()

2022-04-10 Thread Shiyang Ruan
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 located in. With dax_holder notify support, we are able to notify the

[RFC PATCH] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind

2022-04-10 Thread 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 (or mapped device) on it to unmap all files in use and notify processes who are using those files. Call

[PATCH v12 1/7] dax: Introduce holder for dax_device

2022-04-10 Thread Shiyang Ruan
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 will be the instance of this filesystem. - When this pmem

[PATCH v12 0/7] fsdax: introduce fs query to support reflink

2022-04-10 Thread Shiyang Ruan
This patchset is aimed to support shared pages tracking for fsdax. Changes since V11: - Rebased onto next-20220408 - Move dax_register_holder()'s job into fs_dax_get_by_bdev(), and move dax_unregister_holder()'s job into fs_put_dax() - Change ->memory_failure() signature to page-based

[PATCH v12 7/7] fsdax: set a CoW flag when associate reflink mappings

2022-04-10 Thread Shiyang Ruan
Introduce a PAGE_MAPPING_DAX_COW flag to support association with CoW file mappings. In this case, since the dax-rmap has already took the responsibility to look up for shared files by given dax page, the page->mapping is no longer to used for rmap but for marking that this dax page is shared.

[PATCH v12 2/7] mm: factor helpers for memory_failure_dev_pagemap

2022-04-10 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 Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Dan Williams ---

Re: [PATCH v12 2/7] mm: factor helpers for memory_failure_dev_pagemap

2022-04-10 Thread kernel test robot
config: arm64-randconfig-r021-20220410 (https://download.01.org/0day-ci/archive/20220411/202204110348.fupyvjk7-...@intel.com/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 256c6b0ba14e8a7ab6373b61b7193ea8c0a3651c) reproduce (this is a W=1 build): wget https

Re: [PATCH v12 2/7] mm: factor helpers for memory_failure_dev_pagemap

2022-04-10 Thread kernel test robot
Hi Shiyang, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on hnaz-mm/master] [also build test WARNING on next-20220408] [cannot apply to xfs-linux/for-next linus/master linux/master v5.18-rc1] [If your patch is applied to the wrong git tree, kindly drop us a

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

2022-04-10 Thread kernel test robot
Hi Shiyang, Thank you for the patch! Yet something to improve: [auto build test ERROR on hnaz-mm/master] [also build test ERROR on next-20220408] [cannot apply to xfs-linux/for-next linus/master linux/master v5.18-rc1] [If your patch is applied to the wrong git tree, kindly drop us a note. And

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

2022-04-10 Thread kernel test robot
Hi Shiyang, Thank you for the patch! Yet something to improve: [auto build test ERROR on hnaz-mm/master] [also build test ERROR on next-20220408] [cannot apply to xfs-linux/for-next linus/master linux/master v5.18-rc1] [If your patch is applied to the wrong git tree, kindly drop us a note. And