All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 00/31] btrfs buffered iomap support
@ 2021-06-13 13:39 Goldwyn Rodrigues
  2021-06-13 13:39 ` [RFC PATCH 01/31] iomap: Check if blocksize == PAGE_SIZE in to_iomap_page() Goldwyn Rodrigues
                   ` (30 more replies)
  0 siblings, 31 replies; 45+ messages in thread
From: Goldwyn Rodrigues @ 2021-06-13 13:39 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Goldwyn Rodrigues

From: Goldwyn Rodrigues <rgoldwyn@suse.com>

This is an attempt to perform the bufered read and write using iomap on btrfs.
I propose these changes as an RFC because I would like to know on your comments on the feasibility of going ahead with the design. It is not feature complete
with the most important support missing is multi-device and compression.
Sending to BTRFS mailing only for perspective from btrfs developers first.

Locking sequence change
One of the biggest architecture changes is locking extents before pages.
writepage(), called during memory pressure provides the page which is locked
already. Perform a best effort locking and work with what is feasible.
For truncate->invalidatepage(), lock the pages before calling setsize().
Are there any other areas which need to be covered?

TODO
====

Bio submission for multi-device
  Multi-device submission would require some work with respect to asynchronous
  completions. iomap can merge bio's making it larger than extent_map's
  map_length. There is a check in btrfs_map_bio which WARN()s on this.
  Perhaps a more modular approach of having callbacks would be easier to
  deal with.

Compression
  This would require extra flags to iomap, say type IOMAP_ENCODED, which would
  require iomap to read/write complete extents as opposed to performing I/O on
  only what is requested. An additional field io_size would be required to
  know how much of compressed size maps to uncompressed size.


Known issues
============
 BIO Submission: described above
 Random WARN_ON in kernel/locking/lockdep.c:895 points to memory corruption.

Finally, I have added some questions in the patch headers as well.


-- 
Goldwyn


Goldwyn Rodrigues (31):
  iomap: Check if blocksize == PAGE_SIZE in to_iomap_page()
  iomap: Add submit_io to writepage_ops
  iomap: Export iomap_writepage_end_bio()
  iomap: Introduce iomap_readpage_ops
  btrfs: writepage() lock extent before pages
  btrfs: lock extents while truncating
  btrfs: write() perform extent locks before locking page
  btrfs: btrfs_em_to_iomap () to convert em to iomap
  btrfs: Don't process pages if locked_page is NULL
  btrfs: Add btrfs_map_blocks to for iomap_writeback_ops
  btrfs: Use submit_io to submit btrfs writeback bios
  btrfs: endio sequence for writepage
  btrfs: do not checksum for free space inode
  btrfs: end EXTENT_MAP_INLINE writeback early
  btrfs: Switch to iomap_writepages()
  btrfs: remove force_page_uptodate
  btrfs: Introduce btrfs_iomap
  btrfs: Add btrfs_iomap_release()
  btrfs: Add reservation information to btrfs_iomap
  btrfs: Carve out btrfs_buffered_iomap_begin() from write path
  btrfs: Carve out btrfs_buffered_iomap_end from the write path
  btrfs: Set extents delalloc in iomap_end
  btrfs: define iomap_page_ops
  btrfs: Switch to iomap_file_buffered_write()
  btrfs: remove all page related functions
  btrfs: use srcmap for read-before-write cases
  btrfs: Rename end_bio_extent_readpage to btrfs_readpage_endio
  btrfs: iomap_begin() for buffered read
  btrfs: Use iomap_readpage_ops to allocate and submit bio
  btrfs: Do not call btrfs_io_bio_free_csum() if BTRFS_INODE_NODATASUM
    is not set
  btrfs: Switch to iomap_readpage() and iomap_readahead()

 fs/btrfs/ctree.h       |   3 +
 fs/btrfs/disk-io.c     |   9 +-
 fs/btrfs/extent_io.c   | 103 +++++--
 fs/btrfs/extent_io.h   |   4 +
 fs/btrfs/file.c        | 642 ++++++++++++++---------------------------
 fs/btrfs/inode.c       | 219 ++++++++++++--
 fs/gfs2/aops.c         |   4 +-
 fs/iomap/buffered-io.c |  80 +++--
 fs/xfs/xfs_aops.c      |   4 +-
 fs/zonefs/super.c      |   4 +-
 include/linux/iomap.h  |  26 +-
 11 files changed, 601 insertions(+), 497 deletions(-)

-- 
2.31.1


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

end of thread, other threads:[~2021-06-16 20:06 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-13 13:39 [RFC PATCH 00/31] btrfs buffered iomap support Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 01/31] iomap: Check if blocksize == PAGE_SIZE in to_iomap_page() Goldwyn Rodrigues
2021-06-15 14:17   ` Nikolay Borisov
2021-06-13 13:39 ` [RFC PATCH 02/31] iomap: Add submit_io to writepage_ops Goldwyn Rodrigues
2021-06-15 14:15   ` Nikolay Borisov
2021-06-13 13:39 ` [RFC PATCH 03/31] iomap: Export iomap_writepage_end_bio() Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 04/31] iomap: Introduce iomap_readpage_ops Goldwyn Rodrigues
2021-06-15 14:44   ` Nikolay Borisov
2021-06-13 13:39 ` [RFC PATCH 05/31] btrfs: writepage() lock extent before pages Goldwyn Rodrigues
2021-06-15 15:47   ` Nikolay Borisov
2021-06-13 13:39 ` [RFC PATCH 06/31] btrfs: lock extents while truncating Goldwyn Rodrigues
2021-06-16  6:42   ` Nikolay Borisov
2021-06-16 13:13   ` Nikolay Borisov
2021-06-13 13:39 ` [RFC PATCH 07/31] btrfs: write() perform extent locks before locking page Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 08/31] btrfs: btrfs_em_to_iomap () to convert em to iomap Goldwyn Rodrigues
2021-06-16  6:49   ` Nikolay Borisov
2021-06-16  6:51   ` Nikolay Borisov
2021-06-13 13:39 ` [RFC PATCH 09/31] btrfs: Don't process pages if locked_page is NULL Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 10/31] btrfs: Add btrfs_map_blocks to for iomap_writeback_ops Goldwyn Rodrigues
2021-06-16 14:15   ` Nikolay Borisov
2021-06-13 13:39 ` [RFC PATCH 11/31] btrfs: Use submit_io to submit btrfs writeback bios Goldwyn Rodrigues
2021-06-16 14:26   ` Nikolay Borisov
2021-06-13 13:39 ` [RFC PATCH 12/31] btrfs: endio sequence for writepage Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 13/31] btrfs: do not checksum for free space inode Goldwyn Rodrigues
2021-06-16 14:46   ` Nikolay Borisov
2021-06-13 13:39 ` [RFC PATCH 14/31] btrfs: end EXTENT_MAP_INLINE writeback early Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 15/31] btrfs: Switch to iomap_writepages() Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 16/31] btrfs: remove force_page_uptodate Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 17/31] btrfs: Introduce btrfs_iomap Goldwyn Rodrigues
2021-06-16 20:02   ` David Sterba
2021-06-13 13:39 ` [RFC PATCH 18/31] btrfs: Add btrfs_iomap_release() Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 19/31] btrfs: Add reservation information to btrfs_iomap Goldwyn Rodrigues
2021-06-16 20:03   ` David Sterba
2021-06-13 13:39 ` [RFC PATCH 20/31] btrfs: Carve out btrfs_buffered_iomap_begin() from write path Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 21/31] btrfs: Carve out btrfs_buffered_iomap_end from the " Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 22/31] btrfs: Set extents delalloc in iomap_end Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 23/31] btrfs: define iomap_page_ops Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 24/31] btrfs: Switch to iomap_file_buffered_write() Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 25/31] btrfs: remove all page related functions Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 26/31] btrfs: use srcmap for read-before-write cases Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 27/31] btrfs: Rename end_bio_extent_readpage to btrfs_readpage_endio Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 28/31] btrfs: iomap_begin() for buffered read Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 29/31] btrfs: Use iomap_readpage_ops to allocate and submit bio Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 30/31] btrfs: Do not call btrfs_io_bio_free_csum() if BTRFS_INODE_NODATASUM is not set Goldwyn Rodrigues
2021-06-13 13:39 ` [RFC PATCH 31/31] btrfs: Switch to iomap_readpage() and iomap_readahead() Goldwyn Rodrigues

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.