Re: improve the bio allocation interface v2

2022-02-02 Thread Jens Axboe
On Mon, 24 Jan 2022 10:10:48 +0100, Christoph Hellwig wrote:
> this series is posted early because it has wide-ranging changes and could use 
> some
> early ACKs before -rc1.
> 
> It changes the interface to the bio allocators to always pass a block_device 
> and
> the operation, which is information needed for every bio submitted through
> bio_submit.  This means the fields can be directly initialized in bio_init 
> instead
> of first being zeroed and thus should help to micro-optimize even better than 
> the
> __bio_set_dev that Pavel proposed while also cleaning up code.
> 
> [...]

Applied, thanks!

[01/19] fs: remove mpage_alloc
commit: d5f68a42da7a4516e7503c281a54a58727f07dc3
[02/19] nilfs2: remove nilfs_alloc_seg_bio
commit: f0d911927b3c7cf5f9edb5941d0287144a602d0d
[03/19] nfs/blocklayout: remove bl_alloc_init_bio
commit: 5d2ca2132f889bc2c90d6d07fc9fc129cfee8955
[04/19] ntfs3: remove ntfs_alloc_bio
commit: 39146b6f66ba5c107d5c5758a17f290846165b4d
[05/19] dm: bio_alloc can't fail if it is allowed to sleep
commit: 53db984e004c7116ce69e2f4a163664453336ae1
[06/19] dm-crypt: remove clone_init
commit: 3f868c09ea8f40f800c4c644c072d91c9eee0d71
[07/19] dm-snap: use blkdev_issue_flush instead of open coding it
commit: eba33b8ef1b90d8996eceb0569c06a4f784ef2b5
[08/19] dm-thin: use blkdev_issue_flush instead of open coding it
commit: 28d7d128aad5cd2178b158900d58365d1fd3de94
[09/19] drbd: bio_alloc can't fail if it is allow to sleep
commit: 4b1dc86d1857f1007865cab759f2285280692eee
[10/19] rnbd-srv: simplify bio mapping in process_rdma
commit: 1fe0640ff94feae6d21417e2f4f2829b882274b1
[11/19] rnbd-srv: remove struct rnbd_dev_blk_io
commit: d7b78de2b1552e3e7ce3a069f075cc2729aa5c34
[12/19] xen-blkback: bio_alloc can't fail if it is allow to sleep
commit: 7d8d0c658d48705fca35238a8ff601b7c5cbc0de
[13/19] block: move blk_next_bio to bio.c
commit: 3b005bf6acf009abd700e2c652c86e5c209cf63d
[14/19] block: pass a block_device and opf to blk_next_bio
commit: 0a3140ea0fae377c9eaa031b7db1670ae422ed47
[15/19] block: pass a block_device and opf to bio_alloc_bioset
commit: 609be1066731fea86436f5f91022f82e592ab456
[16/19] block: pass a block_device and opf to bio_alloc_kiocb
commit: b77c88c2100ce6a5ec8126c13599b5a7f6663e32
[17/19] block: pass a block_device and opf to bio_alloc
commit: 07888c665b405b1cd3577ddebfeb74f4717a84c4
[18/19] block: pass a block_device and opf to bio_init
commit: 49add4966d79244013fce35f95c6833fae82b8b1
[19/19] block: pass a block_device and opf to bio_reset
commit: a7c50c940477bae89fb2b4f51bd969a2d95d7512

Best regards,
-- 
Jens Axboe





improve the bio allocation interface v2

2022-01-24 Thread Christoph Hellwig
Hi Jens,

this series is posted early because it has wide-ranging changes and could use 
some
early ACKs before -rc1.

It changes the interface to the bio allocators to always pass a block_device and
the operation, which is information needed for every bio submitted through
bio_submit.  This means the fields can be directly initialized in bio_init 
instead
of first being zeroed and thus should help to micro-optimize even better than 
the
__bio_set_dev that Pavel proposed while also cleaning up code.

I have a follow on series to also deal with the bio cloning interfaces that need
even more love, and additional cleanups for the callers which might be material
for the next merge window.

Changes since v1:
 - fix bio_add_page return value handling in rnbd-srv
 - fix bio clenup in rnbd-srv
 - fix a few commit message typos
 - fix a bisection hazard in rnbd
 - fix an initialization order issue in bio_alloc_bioset/bio_init

Diffstat:
 block/bio.c |   73 
 block/blk-flush.c   |4 -
 block/blk-lib.c |   32 ++-
 block/blk-zoned.c   |   14 +-
 block/blk.h |2 
 block/bounce.c  |6 --
 block/fops.c|   35 +++--
 drivers/block/drbd/drbd_actlog.c|5 --
 drivers/block/drbd/drbd_bitmap.c|7 +--
 drivers/block/drbd/drbd_receiver.c  |   32 +++
 drivers/block/floppy.c  |4 -
 drivers/block/pktcdvd.c |8 ---
 drivers/block/rnbd/rnbd-srv-dev.c   |   61 --
 drivers/block/rnbd/rnbd-srv-dev.h   |   18 
 drivers/block/rnbd/rnbd-srv.c   |   45 --
 drivers/block/rnbd/rnbd-srv.h   |1 
 drivers/block/xen-blkback/blkback.c |   25 ++--
 drivers/block/zram/zram_drv.c   |   16 ++-
 drivers/md/bcache/io.c  |3 -
 drivers/md/bcache/journal.c |   16 ++-
 drivers/md/bcache/movinggc.c|4 -
 drivers/md/bcache/request.c |   18 +++-
 drivers/md/bcache/super.c   |8 +--
 drivers/md/bcache/writeback.c   |4 -
 drivers/md/dm-crypt.c   |   27 -
 drivers/md/dm-io.c  |5 --
 drivers/md/dm-log-writes.c  |   39 +++
 drivers/md/dm-snap.c|   21 --
 drivers/md/dm-thin.c|   41 +---
 drivers/md/dm-writecache.c  |7 +--
 drivers/md/dm-zoned-metadata.c  |   26 ++--
 drivers/md/dm.c |   12 ++---
 drivers/md/md-multipath.c   |2 
 drivers/md/md.c |   24 +--
 drivers/md/raid1.c  |8 +--
 drivers/md/raid10.c |   14 ++
 drivers/md/raid5-cache.c|   19 +++--
 drivers/md/raid5-ppl.c  |   13 ++
 drivers/md/raid5.c  |   12 ++---
 drivers/nvdimm/nd_virtio.c  |6 +-
 drivers/nvme/target/io-cmd-bdev.c   |   18 +++-
 drivers/nvme/target/passthru.c  |7 +--
 drivers/nvme/target/zns.c   |   14 +++---
 drivers/scsi/ufs/ufshpb.c   |4 -
 drivers/target/target_core_iblock.c |   11 +
 fs/btrfs/disk-io.c  |   10 +---
 fs/btrfs/extent_io.c|2 
 fs/buffer.c |   14 ++
 fs/crypto/bio.c |   13 ++
 fs/direct-io.c  |5 --
 fs/erofs/zdata.c|5 --
 fs/ext4/page-io.c   |3 -
 fs/ext4/readpage.c  |8 +--
 fs/f2fs/data.c  |7 +--
 fs/gfs2/lops.c  |8 +--
 fs/gfs2/meta_io.c   |4 -
 fs/gfs2/ops_fstype.c|4 -
 fs/hfsplus/wrapper.c|4 -
 fs/iomap/buffered-io.c  |   26 +---
 fs/iomap/direct-io.c|8 ---
 fs/jfs/jfs_logmgr.c |   11 -
 fs/jfs/jfs_metapage.c   |9 +---
 fs/mpage.c  |   34 ++--
 fs/nfs/blocklayout/blocklayout.c|   26 +---
 fs/nilfs2/segbuf.c  |   31 +--
 fs/ntfs3/fsntfs.c   |   27 -
 fs/ocfs2/cluster/heartbeat.c|4 -
 fs/squashfs/block.c |   11 ++---
 fs/xfs/xfs_bio_io.c |   14 ++
 fs/xfs/xfs_buf.c|4 -
 fs/xfs/xfs_log.c|   14 +++---
 fs/zonefs/super.c   |9 +---
 include/linux/bio.h |   30 ++
 kernel/power/swap.c |5 --
 mm/page_io.c|   10 +---
 75 files changed, 372 insertions(+), 759 deletions(-)



Re: improve the bio allocation interface

2022-01-19 Thread Jens Axboe
On 1/18/22 12:19 AM, Christoph Hellwig wrote:
> Hi Jens,
> 
> this series is posted early because it has wide-ranging changes and
> could use some early ACKs before -rc1.
> 
> It changes the interface to the bio allocators to always pass a
> block_device and the operation, which is information needed for every
> bio submitted through bio_submit.  This means the fields can be
> directly initialized in bio_init instead of first being zeroed and
> thus should help to micro-optimize even better than the __bio_set_dev
> that Pavel proposed while also cleaning up code.

Looks pretty straight forward from the block core point of view. Didn't
look too closely at the fs/driver changes yet.

-- 
Jens Axboe




improve the bio allocation interface

2022-01-17 Thread Christoph Hellwig
Hi Jens,

this series is posted early because it has wide-ranging changes and could use 
some
early ACKs before -rc1.

It changes the interface to the bio allocators to always pass a block_device and
the operation, which is information needed for every bio submitted through
bio_submit.  This means the fields can be directly initialized in bio_init 
instead
of first being zeroed and thus should help to micro-optimize even better than 
the
__bio_set_dev that Pavel proposed while also cleaning up code.

I have a follow on series to also deal with the bio cloning interfaces that need
even more love, and additional cleanups for the callers which might be material
for the next merge window.

Diffstat:
 block/bio.c |   73 
 block/blk-flush.c   |4 -
 block/blk-lib.c |   32 ++-
 block/blk-zoned.c   |   14 +-
 block/blk.h |2 
 block/bounce.c  |6 --
 block/fops.c|   35 +++--
 drivers/block/drbd/drbd_actlog.c|5 --
 drivers/block/drbd/drbd_bitmap.c|7 +--
 drivers/block/drbd/drbd_receiver.c  |   31 +++
 drivers/block/floppy.c  |4 -
 drivers/block/pktcdvd.c |8 ---
 drivers/block/rnbd/rnbd-srv-dev.c   |   61 --
 drivers/block/rnbd/rnbd-srv-dev.h   |   18 
 drivers/block/rnbd/rnbd-srv.c   |   45 --
 drivers/block/rnbd/rnbd-srv.h   |1 
 drivers/block/xen-blkback/blkback.c |   25 ++--
 drivers/block/zram/zram_drv.c   |   16 ++-
 drivers/md/bcache/io.c  |3 -
 drivers/md/bcache/journal.c |   16 ++-
 drivers/md/bcache/movinggc.c|4 -
 drivers/md/bcache/request.c |   18 +++-
 drivers/md/bcache/super.c   |8 +--
 drivers/md/bcache/writeback.c   |4 -
 drivers/md/dm-crypt.c   |   27 -
 drivers/md/dm-io.c  |5 --
 drivers/md/dm-log-writes.c  |   39 +++
 drivers/md/dm-snap.c|   21 --
 drivers/md/dm-thin.c|   41 +---
 drivers/md/dm-writecache.c  |7 +--
 drivers/md/dm-zoned-metadata.c  |   26 ++--
 drivers/md/dm.c |   12 ++---
 drivers/md/md-multipath.c   |2 
 drivers/md/md.c |   24 +--
 drivers/md/raid1.c  |8 +--
 drivers/md/raid10.c |   14 ++
 drivers/md/raid5-cache.c|   19 +++--
 drivers/md/raid5-ppl.c  |   13 ++
 drivers/md/raid5.c  |   12 ++---
 drivers/nvdimm/nd_virtio.c  |6 +-
 drivers/nvme/target/io-cmd-bdev.c   |   18 +++-
 drivers/nvme/target/passthru.c  |7 +--
 drivers/nvme/target/zns.c   |   14 +++---
 drivers/scsi/ufs/ufshpb.c   |4 -
 drivers/target/target_core_iblock.c |   11 +
 fs/btrfs/disk-io.c  |   10 +---
 fs/btrfs/extent_io.c|2 
 fs/buffer.c |   14 ++
 fs/crypto/bio.c |   13 ++
 fs/direct-io.c  |5 --
 fs/erofs/zdata.c|5 --
 fs/ext4/page-io.c   |3 -
 fs/ext4/readpage.c  |8 +--
 fs/f2fs/data.c  |7 +--
 fs/gfs2/lops.c  |8 +--
 fs/gfs2/meta_io.c   |4 -
 fs/gfs2/ops_fstype.c|4 -
 fs/hfsplus/wrapper.c|4 -
 fs/iomap/buffered-io.c  |   26 +---
 fs/iomap/direct-io.c|8 ---
 fs/jfs/jfs_logmgr.c |   11 -
 fs/jfs/jfs_metapage.c   |9 +---
 fs/mpage.c  |   34 ++--
 fs/nfs/blocklayout/blocklayout.c|   26 +---
 fs/nilfs2/segbuf.c  |   31 +--
 fs/ntfs3/fsntfs.c   |   27 -
 fs/ocfs2/cluster/heartbeat.c|4 -
 fs/squashfs/block.c |   11 ++---
 fs/xfs/xfs_bio_io.c |   14 ++
 fs/xfs/xfs_buf.c|4 -
 fs/xfs/xfs_log.c|   14 +++---
 fs/zonefs/super.c   |9 +---
 include/linux/bio.h |   30 ++
 kernel/power/swap.c |5 --
 mm/page_io.c|   10 +---
 75 files changed, 372 insertions(+), 758 deletions(-)