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

2021-10-31 Thread kernel test robot
a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Shiyang-Ruan/fsdax-introduce-fs-query-to-support-reflink/20211031-232355 base: https://git.kernel.org/pub/scm/linux/kernel/git

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

2021-10-31 Thread kernel test robot
a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Shiyang-Ruan/fsdax-introduce-fs-query-to-support-reflink/20211031-232355 base: https://git.kernel.org/pub/scm/linux/kernel/git

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

2021-10-31 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 superblock of this filesystem. - When this

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

2021-10-31 Thread Shiyang Ruan
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 dax write lock for registration. Signed-off-by: Shiyang Ruan --- drivers/dax/device.c | 11 drivers/dax/super.c| 51

[PATCH v8 0/8] fsdax: introduce fs query to support reflink

2021-10-31 Thread Shiyang Ruan
This patchset is aimed to support shared pages tracking for fsdax. Changes from V7: - Change dax lock from global rwsem to per-device percpu_rwsem - Change type of range length from size_t to u64 - Rename 'flags' to 'mf_flags' - Fix mistakes in XFS code - Add cow branch for

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

2021-10-31 Thread Shiyang Ruan
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 other filesystems who are not support rmap, we add a is cow flag,

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

2021-10-31 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 BTW, output the page corresponding to the specific dax entry for caller use.

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

2021-10-31 Thread Shiyang Ruan
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 the corrupt data. For now all we do is kill processes with that file

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

2021-10-31 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 --- mm/memory-failure.c | 141

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

2021-10-31 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

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

2021-10-31 Thread Shiyang Ruan
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 mapping,offset instead of struct page. Because different file's mappings and