Skip to content

RFC bdev: allow buffer-head & iomap aops to co-exist

Luis Chamberlain linux-block linux-fsdevel linux-patches linux-xfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4bdev: replace export of blockdev_superblock with BDEVFS_MAGICblock/bdev.c include/linux/fs.h+2 -32 replies
2/4bdev: abstract inode lookup on blkdev_get_no_open()block/bdev.c+7 -20 replies
3/4bdev: rename iomap aopsblock/bdev.c block/blk.h block/fops.c+12 -70 replies
4/4bdev: extend bdev inode with it's own super_blockblock/bdev.c+78 -166 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/4] bdev: allow buffer-head & iomap aops to co-exist

At LSFMM it was clear that for some in order to support large order folios we want to use iomap. So the filesystems staying and requiring buffer-heads cannot make use of high order folios. This simplifies support and reduces the scope for what we need to do in order to support high order folios for buffered-io.

As Christoph's patches show though, we can only end up without buffer-heads if you build and boot a system without any support for any filesystem that requires buffer-heads. That's a tall order today.

We however want to be able to support block devices which may want to completely opt-in to to only use iomap and iomap based filesystems. We cannot do that today. To help with this we must extend the block device cache so to enable each block device to get its own super block, and so to later enable us to pick and choose the aops we use for the block device.

The first patch seems already applicable upstream. The second is just makes future changes easier to read. The third patch probably just needs to be squashed into Christoph's work.

The last patch is the meat of this.

It goes boot tested, and applies on top of Christoph's patches which enable you to build a sytem without buffer-heads. For convenience I've stashed what this looks like on my large-block-20230607-dev-cache branch [0].

The hot swapping of the aops is what would be next, and when we do that. One option is to pursue things as-is now and then only flip if we need high order folios. I'm sure Christoph will have better ideas how to do that cleanly. But this is is what I have so far.

Lemme know how crappy this looks or pitfalls I'm sure I missed.

[0] https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/log/?h=large-block-20230607-dev-cache

Luis Chamberlain (4):
bdev: replace export of blockdev_superblock with BDEVFS_MAGIC
bdev: abstract inode lookup on blkdev_get_no_open()
bdev: rename iomap aops
bdev: extend bdev inode with it's own super_block

 block/bdev.c       | 106 +++++++++++++++++++++++++++++++++++++--------
 block/blk.h        |   1 +
 block/fops.c       |  14 +++---
 include/linux/fs.h |   4 +-
 4 files changed, 98 insertions(+), 27 deletions(-)
Signature · 1 line
2.39.2