linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] iomap: some minor non-critical fixes and improvements when block size < folio size
@ 2024-08-12 12:11 Zhang Yi
  2024-08-12 12:11 ` [PATCH v2 1/6] iomap: correct the range of a partial dirty clear Zhang Yi
                   ` (6 more replies)
  0 siblings, 7 replies; 42+ messages in thread
From: Zhang Yi @ 2024-08-12 12:11 UTC (permalink / raw)
  To: linux-xfs, linux-fsdevel
  Cc: linux-kernel, djwong, hch, brauner, david, jack, willy, yi.zhang,
	yi.zhang, chengzhihao1, yukuai3

From: Zhang Yi <yi.zhang@huawei.com>

Changes since v1:
 - Patch 5 fix a stale data exposure problem pointed out by Willy, drop
   the setting of uptodate bits after zeroing out unaligned range.
 - As Dave suggested, in order to prevent increasing the complexity of
   maintain the state_lock, don't just drop all the state_lock in the
   buffered write path, patch 6 introduce a new helper to set uptodate
   bit and dirty bits together under the state_lock, reduce one time of
   locking per write, the benefits of performance optimization do not
   change too much.

This series contains some minor non-critical fixes and performance
improvements on the filesystem with block size < folio size.

The first 4 patches fix the handling of setting and clearing folio ifs
dirty bits when mark the folio dirty and when invalidat the folio.
Although none of these code mistakes caused a real problem now, it's
still deserve a fix to correct the behavior.

The second 2 patches drop the unnecessary state_lock in ifs when setting
and clearing dirty/uptodate bits in the buffered write path, it could
improve some (~8% on my machine) buffer write performance. I tested it
through UnixBench on my x86_64 (Xeon Gold 6151) and arm64 (Kunpeng-920)
virtual machine with 50GB ramdisk and xfs filesystem, the results shows
below.

UnixBench test cmd:
 ./Run -i 1 -c 1 fstime-w

Before:
x86    File Write 1024 bufsize 2000 maxblocks       524708.0 KBps
arm64  File Write 1024 bufsize 2000 maxblocks       801965.0 KBps

After:
x86    File Write 1024 bufsize 2000 maxblocks       569218.0 KBps
arm64  File Write 1024 bufsize 2000 maxblocks       871605.0 KBps

Thanks,
Yi.

Zhang Yi (6):
  iomap: correct the range of a partial dirty clear
  iomap: support invalidating partial folios
  iomap: advance the ifs allocation if we have more than one blocks per
    folio
  iomap: correct the dirty length in page mkwrite
  iomap: don't mark blocks uptodate after partial zeroing
  iomap: reduce unnecessary state_lock when setting ifs uptodate and
    dirty bits

 fs/iomap/buffered-io.c | 73 ++++++++++++++++++++++++++++++++++--------
 1 file changed, 60 insertions(+), 13 deletions(-)

-- 
2.39.2


^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2024-08-17  7:16 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-12 12:11 [PATCH v2 0/6] iomap: some minor non-critical fixes and improvements when block size < folio size Zhang Yi
2024-08-12 12:11 ` [PATCH v2 1/6] iomap: correct the range of a partial dirty clear Zhang Yi
2024-08-12 16:33   ` Darrick J. Wong
2024-08-13  2:14     ` Zhang Yi
2024-08-14  1:53     ` Dave Chinner
2024-08-12 12:11 ` [PATCH v2 2/6] iomap: support invalidating partial folios Zhang Yi
2024-08-12 16:55   ` Darrick J. Wong
2024-08-12 12:11 ` [PATCH v2 3/6] iomap: advance the ifs allocation if we have more than one blocks per folio Zhang Yi
2024-08-12 12:47   ` yangerkun
2024-08-13  2:21     ` Zhang Yi
2024-08-14  5:32   ` Christoph Hellwig
2024-08-14  7:08     ` Zhang Yi
2024-08-15  6:00       ` Christoph Hellwig
2024-08-16  1:44         ` Zhang Yi
2024-08-17  4:27     ` Zhang Yi
2024-08-17  4:42       ` Matthew Wilcox
2024-08-17  6:16         ` Zhang Yi
2024-08-12 12:11 ` [PATCH v2 4/6] iomap: correct the dirty length in page mkwrite Zhang Yi
2024-08-12 16:45   ` Darrick J. Wong
2024-08-13  2:49     ` Zhang Yi
2024-08-14  5:36   ` Christoph Hellwig
2024-08-14  7:49     ` Zhang Yi
2024-08-15  5:59       ` Christoph Hellwig
2024-08-16  2:19         ` Zhang Yi
2024-08-17  4:45   ` Matthew Wilcox
2024-08-17  6:43     ` Zhang Yi
2024-08-12 12:11 ` [PATCH v2 5/6] iomap: don't mark blocks uptodate after partial zeroing Zhang Yi
2024-08-12 16:49   ` Darrick J. Wong
2024-08-13  3:01     ` Zhang Yi
2024-08-14  5:39   ` Christoph Hellwig
2024-08-17  4:48   ` Matthew Wilcox
2024-08-17  7:16     ` Zhang Yi
2024-08-12 12:11 ` [PATCH v2 6/6] iomap: reduce unnecessary state_lock when setting ifs uptodate and dirty bits Zhang Yi
2024-08-12 16:54   ` Darrick J. Wong
2024-08-12 17:00   ` Matthew Wilcox
2024-08-13  8:15     ` Zhang Yi
2024-08-14  1:49 ` [PATCH v2 0/6] iomap: some minor non-critical fixes and improvements when block size < folio size Dave Chinner
2024-08-14  2:14   ` Zhang Yi
2024-08-14  2:47     ` Dave Chinner
2024-08-14  3:57       ` Zhang Yi
2024-08-14  5:16         ` Dave Chinner
2024-08-14  6:32           ` Zhang Yi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).