This RFC PATCH series adds support for large folio buffered writes
to regular readable and writable files in f2fs with exception of 
atomic/compressed/inlined files. 
Since adapting page writeback to support large folios is relatively complex, 
it is not included in this series.

I ran simple `dd` tests on a Pixel 6 device. 
During the tests, dirty page writeback was temporarily disabled.
---------------------------------------------------------------------------------
Test:
echo 100 > /proc/sys/vm/dirty_ratio
echo 100 > /proc/sys/vm/dirty_background_ratio
echo 0 > /proc/sys/vm/dirty_writeback_centisecs
echo 8640000 > /proc/sys/vm/dirty_expire_centisecs

Before large folio enable:
oriole:/data # dd if=/dev/zero of=lf.c bs=2M count=500
500+0 records in
500+0 records out
1048576000 bytes (0.9 G) copied, 0.815 s, 1.1 G/s

After large folio enable:
oriole:/data # dd if=/dev/zero of=lf.c bs=2M count=500                          
                     
500+0 records in
500+0 records out
1048576000 bytes (0.9 G) copied, 0.330 s, 2.9 G/s
---------------------------------------------------------------------------------
Note: 
- bs=2M means always allocating the largest folio order in buffered write,
  so it represents a theoretical maximum write performance.
- Because large folio support can only be enabled for files via f2fs_iget,
  it may be more convenient for testing to create a large file first and then 
  immediately reboot the device so that the inode is reloaded.

**Discussion:**  
I would like to add fault injection to `f2fs_write_end` to simulate short 
writes 
(copied != len). 
However, I am concerned that directly adding time_to_inject inside 
f2fs_write_end 
and returning 0 may cause generic_perform_write to loop forever during testing. 
Better ideas are appreciated.

Thanks.

---



Nanzhe Zhao (5):
  f2fs: Move f2fs_folio_state to f2fs.h
  f2fs: Introduce f2fs_inode_may_use_large_folio
  f2fs: Preallocate partial-write blocks for large-folio write
  f2fs: Support large folios buffered write
  f2fs: Make folio->private flags work with folio state

 fs/f2fs/data.c  | 226 ++++++++++++++++++++++++++++++++++++++++++++----
 fs/f2fs/f2fs.h  |  58 ++++++++++---
 fs/f2fs/file.c  |  21 +++--
 fs/f2fs/inode.c |   3 +-
 4 files changed, 272 insertions(+), 36 deletions(-)


base-commit: bc367775f60214312befa33f101b31fe74bba48a
-- 
2.34.1



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to