dax: Add a dax-rmap tree to support reflink
From: | Shiyang Ruan <ruansy.fnst-AT-cn.fujitsu.com> | |
To: | <linux-kernel-AT-vger.kernel.org>, <linux-xfs-AT-vger.kernel.org>, <linux-nvdimm-AT-lists.01.org> | |
Subject: | [RFC PATCH 0/8] dax: Add a dax-rmap tree to support reflink | |
Date: | Mon, 27 Apr 2020 16:47:42 +0800 | |
Message-ID: | <20200427084750.136031-1-ruansy.fnst@cn.fujitsu.com> | |
Cc: | <linux-mm-AT-kvack.org>, <linux-fsdevel-AT-vger.kernel.org>, <darrick.wong-AT-oracle.com>, <dan.j.williams-AT-intel.com>, <david-AT-fromorbit.com>, <hch-AT-lst.de>, <rgoldwyn-AT-suse.de>, <qi.fuli-AT-fujitsu.com>, <y-goto-AT-fujitsu.com> | |
Archive-link: | Article |
This patchset is a try to resolve the shared 'page cache' problem for fsdax. In order to track multiple mappings and indexes on one page, I introduced a dax-rmap rb-tree to manage the relationship. A dax entry will be associated more than once if is shared. At the second time we associate this entry, we create this rb-tree and store its root in page->private(not used in fsdax). Insert (->mapping, ->index) when dax_associate_entry() and delete it when dax_disassociate_entry(). We can iterate the dax-rmap rb-tree before any other operations on mappings of files. Such as memory-failure and rmap. Same as before, I borrowed and made some changes on Goldwyn's patchsets. These patches makes up for the lack of CoW mechanism in fsdax. The rests are dax & reflink support for xfs. (Rebased to 5.7-rc2) Shiyang Ruan (8): fs/dax: Introduce dax-rmap btree for reflink mm: add dax-rmap for memory-failure and rmap fs/dax: Introduce dax_copy_edges() for COW fs/dax: copy data before write fs/dax: replace mmap entry in case of CoW fs/dax: dedup file range to use a compare function fs/xfs: handle CoW for fsdax write() path fs/xfs: support dedupe for fsdax fs/dax.c | 343 +++++++++++++++++++++++++++++++++++++---- fs/ocfs2/file.c | 2 +- fs/read_write.c | 11 +- fs/xfs/xfs_bmap_util.c | 6 +- fs/xfs/xfs_file.c | 10 +- fs/xfs/xfs_iomap.c | 3 +- fs/xfs/xfs_iops.c | 11 +- fs/xfs/xfs_reflink.c | 79 ++++++---- include/linux/dax.h | 11 ++ include/linux/fs.h | 9 +- mm/memory-failure.c | 63 ++++++-- mm/rmap.c | 54 +++++-- 12 files changed, 498 insertions(+), 104 deletions(-) -- 2.26.2