From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E5F0C43600 for ; Wed, 12 May 2021 13:16:24 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CFE0861260 for ; Wed, 12 May 2021 13:16:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CFE0861260 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=pYb7M/NrxO5wJYzEzV/Wr4jC65NbQAG6dFS0WeKzlcY=; b=O/20GaMMYPtdRXbR/oDniZmZ7u MTwhkZXC4KXPkL082mBYnrlgAMj2eeo9US1WKHW7ax4vVu3mVDthSYfnzWA3hsUNbWo53sKsKlKQZ BcVtYIdfI6lWvRMXbMyjGpEKvxaCEtTKf8SQD0P47cLeFt1/3K8/ze6cauX3+ANUDQ4cFSGTnZhw3 rJffEZ9nEkHrWkdluINyh16H9CEMftAztTB+wea2HbIU8J4CGEUcftybGrSuAzO8VAx9v2obHSga/ H+fHnJGck8E/HfceMy/t6l587MMXmhGLKb9AR+B+KMVoVkSB3Jfbtc3BUf6xo6HE1cwoZn9/828AB k8VRVTDQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lgoiP-002raZ-I1; Wed, 12 May 2021 13:15:53 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgoiM-002raN-W8 for linux-nvme@desiato.infradead.org; Wed, 12 May 2021 13:15:51 +0000 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=1OCL/hRNShP+g+9KTCWxVijSB16WuFeB9C7Nlxg2oYA=; b=ClHGVYjhtaCjJViCCOY2Q3LX8h ECzIdD0JW4nhG3NFaJWLQl8RghYQp3INYuWDjt2zmtIfhD06CyQIlMGVFjMedyZiTFTbsOyXv0woX pXRzfKE7VBBd1OIOMqv0IrLqy56+Der1Dg4LWkya1ChyJwVi1Rv0fd6BktiqYOaTHuYEhZwgp52kI tWzQubvVoen6aM7SDE/MMmXAyTAiTV/cwOOR9l8BU+40w+L0Ag1EuPwDmuSsP5LRbvh0bViZr3uyc jQUbv05FjA73+JJ6nUZ7Wvxfw8pyf4ZU0Oa6Ip321+vG2bpUcvzMGm/11A6rSbacNP0Jq+XKpwihB 0CwR6K+w==; Received: from [2001:4bb8:198:fbc8:1036:7ab9:f97a:adbc] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lgoiJ-00AO1O-8l; Wed, 12 May 2021 13:15:47 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Jeffle Xu , Ming Lei , Damien Le Moal , Keith Busch , Sagi Grimberg , "Wunderlich, Mark" , "Vasudevan, Anil" , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-nvme@lists.infradead.org Subject: switch block layer polling to a bio based model v3 Date: Wed, 12 May 2021 15:15:30 +0200 Message-Id: <20210512131545.495160-1-hch@lst.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org Hi all, This series clean up the block polling code a bit and changes the interface to poll for a specific bio instead of a request_queue and cookie pair. Polling for the bio itself leads to a few advantages: - the cookie construction can made entirely private in blk-mq.c - the caller does not need to remember the request_queue and cookie separately and thus sidesteps their lifetime issues - keeping the device and the cookie inside the bio allows to trivially support polling BIOs remapping by stacking drivers - a lot of code to propagate the cookie back up the submission path can removed entirely The one major caveat is that this requires RCU freeing polled BIOs to make sure the bio that contains the polling information is still alive when io_uring tries to poll it through the iocb. For synchronous polling all the callers have a bio reference anyway, so this is not an issue. Git tree: git://git.infradead.org/users/hch/block.git bio-poll Gitweb: http://git.infradead.org/users/hch/block.git/shortlog/refs/heads/bio-poll Chances since v2: - remove support for writing to the poll attribute - better document the block_device life time assumptions in bio_poll - only set QUEUE_FLAG_POLL on nvme-multipath queues where it makes sense Chances since v1: - use SLAB_TYPESAFE_BY_RCU to only free the pages backing the bio slabs bio RCU - split the spin argument to bio_poll to avoid sleeping under RCU from io_uring - add support for polling nvme multipath devices Diffstat: arch/m68k/emu/nfblock.c | 3 arch/xtensa/platforms/iss/simdisk.c | 3 block/bio.c | 4 block/blk-core.c | 122 ++++++++++++++++++------- block/blk-merge.c | 2 block/blk-mq-debugfs.c | 2 block/blk-mq.c | 173 ++++++++++++++---------------------- block/blk-mq.h | 6 - block/blk-sysfs.c | 23 ---- drivers/block/brd.c | 12 +- drivers/block/drbd/drbd_int.h | 2 drivers/block/drbd/drbd_req.c | 3 drivers/block/n64cart.c | 12 +- drivers/block/null_blk/main.c | 3 drivers/block/pktcdvd.c | 7 - drivers/block/ps3vram.c | 6 - drivers/block/rsxx/dev.c | 7 - drivers/block/zram/zram_drv.c | 10 -- drivers/lightnvm/pblk-init.c | 6 - drivers/md/bcache/request.c | 13 +- drivers/md/bcache/request.h | 4 drivers/md/dm.c | 28 ++--- drivers/md/md.c | 10 -- drivers/nvdimm/blk.c | 5 - drivers/nvdimm/btt.c | 5 - drivers/nvdimm/pmem.c | 3 drivers/nvme/host/core.c | 4 drivers/nvme/host/multipath.c | 17 ++- drivers/s390/block/dcssblk.c | 7 - drivers/s390/block/xpram.c | 5 - fs/block_dev.c | 54 +++-------- fs/btrfs/inode.c | 8 - fs/direct-io.c | 14 -- fs/ext4/file.c | 2 fs/gfs2/file.c | 4 fs/io_uring.c | 14 +- fs/iomap/direct-io.c | 56 ++++++----- fs/xfs/xfs_file.c | 2 fs/zonefs/super.c | 2 include/linux/bio.h | 4 include/linux/blk-mq.h | 15 --- include/linux/blk_types.h | 34 +------ include/linux/blkdev.h | 12 +- include/linux/bvec.h | 2 include/linux/fs.h | 8 - include/linux/iomap.h | 3 mm/page_io.c | 10 -- 47 files changed, 342 insertions(+), 409 deletions(-) _______________________________________________ Linux-nvme mailing list Linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme