fio seqread benchmark, 100% cpu usage

2021-02-07 Thread Christian Braun
Hi, i am benchmarking a new setup with fio to use with btrfs. When doing a seqread test the system cpu usage is at 100% and read performance is degraded. There are 8 "kworker/u64:0+btrfs-endio" (the machine has 8 cores) using all the cpu resources. That does not seem right. With seqwrite this doe

is BTRFS_IOC_DEFRAG behavior optimal?

2021-02-07 Thread Chris Murphy
systemd-journald journals on Btrfs default to nodatacow, upon log rotation it's submitted for defragmenting with BTRFS_IOC_DEFRAG. The result looks curious. I can't tell what the logic is from the results. The journal file starts out being fallocated with a size of 8MB, and as it grows there is a

[PATCH 5/7] fsdax: Dedup file range to use a compare function

2021-02-07 Thread Shiyang Ruan
With dax we cannot deal with readpage() etc. So, we create a funciton callback to perform the file data comparison and pass it to generic_remap_file_range_prep() so it can use iomap-based functions. Signed-off-by: Goldwyn Rodrigues Signed-off-by: Shiyang Ruan --- fs/btrfs/reflink.c | 3 +- f

[PATCH 6/7] fs/xfs: Handle CoW for fsdax write() path

2021-02-07 Thread Shiyang Ruan
In fsdax mode, WRITE and ZERO on a shared extent need CoW mechanism performed. After CoW, new extents needs to be remapped to the file. Signed-off-by: Shiyang Ruan --- fs/xfs/xfs_bmap_util.c | 6 +- fs/xfs/xfs_file.c | 10 +++--- fs/xfs/xfs_iomap.c | 3 ++- fs/xfs/xfs_iops.c

[PATCH 7/7] fs/xfs: Add dedupe support for fsdax

2021-02-07 Thread Shiyang Ruan
Add xfs_break_two_dax_layouts() to break layout for tow dax files. Then call compare range function only when files are both DAX or not. Signed-off-by: Shiyang Ruan --- fs/xfs/xfs_file.c| 20 fs/xfs/xfs_inode.c | 8 +++- fs/xfs/xfs_inode.h | 1 + fs/xfs/xfs_re

[PATCH 4/7] fsdax: Replace mmap entry in case of CoW

2021-02-07 Thread Shiyang Ruan
We replace the existing entry to the newly allocated one in case of CoW. Also, we mark the entry as PAGECACHE_TAG_TOWRITE so writeback marks this entry as writeprotected. This helps us snapshots so new write pagefaults after snapshots trigger a CoW. Signed-off-by: Goldwyn Rodrigues Signed-off-by:

[PATCH 2/7] fsdax: Introduce dax_copy_edges() for CoW

2021-02-07 Thread Shiyang Ruan
dax_copy_edges() is a helper functions performs a copy from one part of the device to another for data not page aligned. Signed-off-by: Goldwyn Rodrigues Signed-off-by: Shiyang Ruan --- fs/dax.c | 41 + 1 file changed, 41 insertions(+) diff --git a/fs/da

[PATCH 0/7] fsdax,xfs: Add reflink&dedupe support for fsdax

2021-02-07 Thread Shiyang Ruan
This patchset is attempt to add CoW support for fsdax, and take XFS, which has both reflink and fsdax feature, as an example. One of the key mechanism need to be implemented in fsdax is CoW. Copy the data from srcmap before we actually write data to the destance iomap. And we just copy range in

[PATCH 3/7] fsdax: Copy data before write

2021-02-07 Thread Shiyang Ruan
Add dax_copy_edges() into each dax actor functions to perform CoW. Signed-off-by: Shiyang Ruan --- fs/dax.c | 37 ++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index ea4e8a434900..b2195cbdf2dc 100644 --- a/fs/dax.c +++ b/

[PATCH 1/7] fsdax: Output address in dax_iomap_pfn() and rename it

2021-02-07 Thread Shiyang Ruan
Add address output in dax_iomap_pfn() in order to perform a memcpy() in CoW case. Since this function both output address and pfn, rename it to dax_iomap_direct_access(). Signed-off-by: Shiyang Ruan --- fs/dax.c | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) diff -