From: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
To: linux-xfs@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org,
Matthew Wilcox <willy@infradead.org>,
Dave Chinner <david@fromorbit.com>,
Brian Foster <bfoster@redhat.com>,
Ojaswin Mujoo <ojaswin@linux.ibm.com>,
Disha Goel <disgoel@linux.ibm.com>,
"Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Subject: [RFCv5 0/5] iomap: Add support for per-block dirty state to improve write performance
Date: Mon, 8 May 2023 00:57:55 +0530 [thread overview]
Message-ID: <cover.1683485700.git.ritesh.list@gmail.com> (raw)
Hello,
Please find version-5 of this series. v5 mainly addresses the review comments
from Matthew to have a better iop->state bitmap handling functions.
Please do let me know if any comments/feedback.
Testing
=========
Continuing to run more tests, but so far I haven't observed any surprises
on my 1k and 4k blocksize with default options & -g "auto" runs.
<Pasting RFCv3 => RFCv4 relevant changelog for v5 and dopping everything else>
========================================================================
This addresses a problem reported by Brian for a short write case with delalloc
release. This is addressed in patch-5 in function iomap_write_delalloc_scan().
I suppose this is a major change from the previous rfcv3.
I did test a unit test which Brian provided with xfs_io -f option.
Before those changes, the kernel caused a bug_on during unmount
with the unit test. This gets fixed with the changes added in v4.
i.e. After v4
=================
root@ubuntu# ./xfs_io -fc "truncate 4k" -c "mmap 0 4k" -c "mread 0 4k" -c "pwrite 0 1" -c "pwrite -f 2k 1" -c fsync /mnt1/tmnt/testfile
wrote 1/1 bytes at offset 0
1.000000 bytes, 1 ops; 0.0001 sec (7.077 KiB/sec and 7246.3768 ops/sec)
pwrite: Bad address
root@ubuntu# ./xfs_io -c "fiemap -v" /mnt1/tmnt/testfile
/mnt1/tmnt/testfile:
EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS
0: [0..1]: 22..23 2 0x1
1: [2..7]: hole 6
root@ubuntu# filefrag -v /mnt1/tmnt/testfile
Filesystem type is: 58465342
File size of /mnt1/tmnt/testfile is 4096 (4 blocks of 1024 bytes)
ext: logical_offset: physical_offset: length: expected: flags:
0: 0.. 0: 11.. 11: 1: last
/mnt1/tmnt/testfile: 1 extent found
root@ubuntu# umount /mnt1/tmnt
root@ubuntu#
Before v4
===========
root@ubuntu# mount /dev/loop8 /mnt1/test
root@ubuntu# ./xfs_io -fc "truncate 4k" -c "mmap 0 4k" -c "mread 0 4k" -c "pwrite 0 1" -c "pwrite -f 2k 1" -c fsync /mnt1/test/testfile
wrote 1/1 bytes at offset 0
1.000000 bytes, 1 ops; 0.0000 sec (10.280 KiB/sec and 10526.3158 ops/sec)
pwrite: Bad address
root@ubuntu# ./xfs_io -c "fiemap -v" /mnt1/test/testfile
/mnt1/test/testfile:
EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS
0: [0..1]: 22..23 2 0x0
1: [2..3]: hole 2
2: [4..5]: 0..1 2 0x7
3: [6..7]: hole 2
root@ubuntu# filefrag -v /mnt1/test/testfile
Filesystem type is: 58465342
File size of /mnt1/test/testfile is 4096 (4 blocks of 1024 bytes)
ext: logical_offset: physical_offset: length: expected: flags:
0: 0.. 0: 11.. 11: 1:
1: 2.. 2: 0.. 0: 0: last,unknown_loc,delalloc
/mnt1/test/testfile: 2 extents found
root@ubuntu# umount /mnt1/test
<dmesg snip>
[ 156.581188] XFS (loop8): Unmounting Filesystem 7889507d-fc7f-4a1c-94d5-06797f2cc790
[ 156.584455] XFS (loop8): ino 43 data fork has delalloc extent at [0x2:0x1]
[ 156.587847] XFS: Assertion failed: 0, file: fs/xfs/xfs_icache.c, line: 1816
[ 156.591675] ------------[ cut here ]------------
[ 156.594133] kernel BUG at fs/xfs/xfs_message.c:102!
[ 156.596669] invalid opcode: 0000 [#1] PREEMPT SMP PTI
[ 156.599277] CPU: 7 PID: 435 Comm: kworker/7:5 Not tainted 6.3.0-rc6-xfstests-00003-g99a844f4e411-dirty #105
[ 156.603721] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
[ 156.608701] Workqueue: xfs-inodegc/loop8 xfs_inodegc_worker
[ 156.611426] RIP: 0010:assfail+0x38/0x40
[ 156.646981] Call Trace:
[ 156.647951] <TASK>
[ 156.648904] xfs_inodegc_set_reclaimable+0x15b/0x160
[ 156.651270] xfs_inodegc_worker+0x95/0x1d0
[ 156.653202] process_one_work+0x274/0x550
[ 156.655305] worker_thread+0x4f/0x300
[ 156.657081] ? __pfx_worker_thread+0x10/0x10
[ 156.658977] kthread+0xf6/0x120
[ 156.660657] ? __pfx_kthread+0x10/0x10
[ 156.662565] ret_from_fork+0x2c/0x50
[ 156.664421] </TASK>
Previous changelogs & TODOs at [1]
[1]: https://lore.kernel.org/linux-xfs/cover.1683208091.git.ritesh.list@gmail.com/
Ritesh Harjani (IBM) (5):
iomap: Rename iomap_page_create/release() to iop_alloc/free()
iomap: Refactor iop_set_range_uptodate() function
iomap: Add iop's uptodate state handling functions
iomap: Allocate iop in ->write_begin() early
iomap: Add per-block dirty state tracking to improve performance
fs/gfs2/aops.c | 2 +-
fs/iomap/buffered-io.c | 264 ++++++++++++++++++++++++++++++++---------
fs/xfs/xfs_aops.c | 2 +-
fs/zonefs/file.c | 2 +-
include/linux/iomap.h | 1 +
5 files changed, 210 insertions(+), 61 deletions(-)
--
2.39.2
next reply other threads:[~2023-05-07 19:28 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-07 19:27 Ritesh Harjani (IBM) [this message]
2023-05-07 19:27 ` [RFCv5 1/5] iomap: Rename iomap_page_create/release() to iop_alloc/free() Ritesh Harjani (IBM)
2023-05-18 6:13 ` Christoph Hellwig
2023-05-19 15:01 ` Ritesh Harjani
2023-05-07 19:27 ` [RFCv5 2/5] iomap: Refactor iop_set_range_uptodate() function Ritesh Harjani (IBM)
2023-05-07 21:54 ` kernel test robot
2023-05-08 2:42 ` kernel test robot
2023-05-15 15:09 ` Brian Foster
2023-05-16 10:12 ` Ritesh Harjani
2023-05-18 6:16 ` Christoph Hellwig
2023-05-19 15:03 ` Ritesh Harjani
2023-05-07 19:27 ` [RFCv5 3/5] iomap: Add iop's uptodate state handling functions Ritesh Harjani (IBM)
2023-05-15 15:10 ` Brian Foster
2023-05-16 10:14 ` Ritesh Harjani
2023-05-18 6:18 ` Christoph Hellwig
2023-05-19 15:07 ` Ritesh Harjani
2023-05-23 6:00 ` Christoph Hellwig
2023-05-07 19:27 ` [RFCv5 4/5] iomap: Allocate iop in ->write_begin() early Ritesh Harjani (IBM)
2023-05-18 6:21 ` Christoph Hellwig
2023-05-19 15:18 ` Ritesh Harjani
2023-05-19 15:53 ` Matthew Wilcox
2023-05-22 4:05 ` Ritesh Harjani
2023-05-07 19:28 ` [RFCv5 5/5] iomap: Add per-block dirty state tracking to improve performance Ritesh Harjani (IBM)
2023-05-07 22:14 ` kernel test robot
2023-05-08 5:00 ` kernel test robot
2023-05-15 8:16 ` Pankaj Raghav
2023-05-15 8:31 ` Ritesh Harjani
2023-05-15 13:23 ` Pankaj Raghav
2023-05-15 15:15 ` Brian Foster
2023-05-16 14:49 ` Ritesh Harjani
2023-05-16 19:29 ` Brian Foster
2023-05-17 15:20 ` Ritesh Harjani
2023-05-17 18:48 ` Brian Foster
2023-05-18 13:23 ` Christoph Hellwig
2023-05-18 16:15 ` Matthew Wilcox
2023-05-22 4:33 ` Ritesh Harjani
2023-05-22 4:48 ` Matthew Wilcox
2023-05-22 11:18 ` Brian Foster
2023-05-23 0:56 ` Darrick J. Wong
2023-05-23 12:15 ` Brian Foster
2023-05-23 13:43 ` Ritesh Harjani
2023-05-23 14:44 ` Brian Foster
2023-05-23 15:02 ` Ritesh Harjani
2023-05-23 15:22 ` Brian Foster
2023-05-23 15:38 ` Ritesh Harjani
2023-05-23 15:59 ` Matthew Wilcox
2023-05-18 13:27 ` Christoph Hellwig
2023-05-19 16:08 ` Ritesh Harjani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1683485700.git.ritesh.list@gmail.com \
--to=ritesh.list@gmail.com \
--cc=bfoster@redhat.com \
--cc=david@fromorbit.com \
--cc=disgoel@linux.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.