Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3503451pxb; Mon, 24 Jan 2022 10:55:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBHP8C24ZicJkgOeF7KPzqGzDWkdZHlPNXlkrbf6HCblMN+YYzd+9xuqosZ7Ec7VboxzSF X-Received: by 2002:a17:902:aa92:b0:149:6e0b:18d0 with SMTP id d18-20020a170902aa9200b001496e0b18d0mr15333451plr.34.1643050558299; Mon, 24 Jan 2022 10:55:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643050558; cv=none; d=google.com; s=arc-20160816; b=h+EdqudiTG2y2OE9DuIsFyZVvl9M5KZk+rspCG9l0AdFEiHWRl8yhqxTtnhEb9mpwf mYk6R+7GJ4gvfOdbdR/tozTRXnu26FmCBgh1AYAdInZR6LNjTE39ofaiG0BYqGszT7oJ lqp5FPVZ4wPIiT7qEB5BOmHocb4oMluRegFuzMYQfk3Pm0GYlqsMjUMM/fDMxb6v/2Vk 3d5ZE0Dy7OyU1jOBfNN1A9f+26Vk94Ssg+9ZCY9MKBolPtDEl8JPxtc396oSa2EHCWYm u+9ZiPasx1RdjiDODZw4J5l4ktsDpWcH44isxp8EB23JUzIyTRpqvQQtSr3nwNO3yjQr N08g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1yiFS3ezJsiNcQQCNo+FJNFqcIQE91ajvdAy/sKWSB4=; b=jX2GcjyWNs1t43m8nScHAMLCp6Wb5TKKaSKz9K3Qg/vEp71DTNw6xNkLLS2/9BOxDN kd41G435OFeB6bXhfQ0TGcQml65BWZcHymNS7vMsZontRdjnXhMKDMrXBUjjD74Vw3ns cqnKL+9jUhcVSahIYCggAj2dIor8kkVYAV11mecpP70iX32MQKlfvlNcXXsLIH40hmBv tWzuXteYKpe5rS8PXp8ryIxaitwFQTJqQNHbPTLVSmP4mvO1/HoZLKA0r1JAXU6r5wSe bKs3uKSbRxyfWj5IBRee6thaOs68A+DmQK9Ov5i3/76ym7vx1p69KG+jr64b7knsvXmZ Ptzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=dNNxqAx0; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x4si12576356plo.108.2022.01.24.10.55.45; Mon, 24 Jan 2022 10:55:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=dNNxqAx0; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242592AbiAXJLU (ORCPT + 99 others); Mon, 24 Jan 2022 04:11:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242498AbiAXJLT (ORCPT ); Mon, 24 Jan 2022 04:11:19 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F01CC06173B; Mon, 24 Jan 2022 01:11:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=1yiFS3ezJsiNcQQCNo+FJNFqcIQE91ajvdAy/sKWSB4=; b=dNNxqAx0zWkEqdV7/b0emSzmAV KVVvuwIWXkQFQyoYY5YDqz/URzmW+OjGlUuB44FdPtaVwG1P5GtdplXzkCndI0bH60IkUO47UPLhz S2JoUcpt/7LvHhHWafiGFH0X+1iwj0YVxms2MtUklTePRVn1uenKkqD6Cg2SPrGLnop53TzV6Arcx T6i0YUlPLY7zKouXXV6jM5xu0eEr7/gTFvHBrNjHv0AoD45hIui+1gO9NpOzTBe/TKD2uDehDoPiS jTeEj1oSSUGDKTwEGspNcmf1o9fhjOWrT04yzhTW12m4CCWbYLYRpFkmXrRjZ+n7HrnRzdFlYOCPQ x4FPDuIg==; Received: from [2001:4bb8:184:72a4:a337:a75f:a24e:7e39] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nBvNV-002jyR-9a; Mon, 24 Jan 2022 09:11:09 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Pavel Begunkov , Mike Snitzer , Ryusuke Konishi , Konstantin Komarov , Andrew Morton , "Md . Haris Iqbal " , Jack Wang , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Philipp Reisner , Lars Ellenberg , linux-block@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-nilfs@vger.kernel.org, ntfs3@lists.linux.dev, xen-devel@lists.xenproject.org, drbd-dev@lists.linbit.com Subject: improve the bio allocation interface v2 Date: Mon, 24 Jan 2022 10:10:48 +0100 Message-Id: <20220124091107.642561-1-hch@lst.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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(-)