Message ID | cover.1666347703.git.asml.silence@gmail.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp623072wrr; Fri, 21 Oct 2022 03:44:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6DCoVu6sxUXdZBodxXV1bJbE/qJjfWnjpJLmxvwpRqL39Ns54zqidjygFmf0GIyLp+LU43 X-Received: by 2002:a17:906:5d04:b0:722:f46c:b891 with SMTP id g4-20020a1709065d0400b00722f46cb891mr14845038ejt.4.1666349082452; Fri, 21 Oct 2022 03:44:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666349082; cv=none; d=google.com; s=arc-20160816; b=kxX2g352g6cPckIqZU+fYudxqcM08EP7W4swrAEe6BBOq8PvHnyGsozI4vBz9EIQvZ rKxyofoEz1HIVYnCEIbJKZUoi5EOiAi6GLXqsGKVpDM7eiBZVQkX0hcei8ztgZBuPjId 5TDnV1adc9HAq5lR/t6IRmxw8sDVGMkVVfoLyN2F4ljz/gSfz14AumFfeoA0nJR/8RrC k4R+NiyEhi27qAIfaYP54bFxPIbDIB6BfYYY8d9Vjx5MeC+Qixp7ffvQsjNyc8g2lCVv MPlOKQoOGUtiGETDUw/AcJRPZXfw9SRPZILGbguUOVpm4ayDzAubaul720aCOZGb8DCP SjEQ== 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=sBF0+eXXDy0WFwTI1/e0oRNDrvv6x7YYh8atYvH+z4U=; b=RU71zRw9HNgXweLJtmxceJpSQkQRSzD1zPyNVvL2VYsE+qmKj3eknXNuE0g9fqFcao PMvgejrzLpIFaj/P7TqOsdrD1djZd34bb1efO8krJGD7+Pr3Ch0RnV8f3VJjwtDzyEKg xR5D7xoq8oiYJSq0eAsyB4HEDDCPPoutcJAWGuFBPGmxBtXNEPrzv5KKsi+h5Itj33tR SZq/PaU1/yWzIhng2xHYDMO0iEgZvgBJTKJWBLWEAuAuxZ1ClqfVWQIIj/FH4KFyZTQg f9q/+djjr5QGeQsmCjIA/m4dDX5JJfnl+gVaxOF6IdTVEhvl/fXPt0GjMuKY3Tas/8Nz hOsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GqBimMsU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y11-20020a50eb0b000000b0045b50cee511si17869055edp.122.2022.10.21.03.44.17; Fri, 21 Oct 2022 03:44:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GqBimMsU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229776AbiJUKgV (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Fri, 21 Oct 2022 06:36:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229910AbiJUKgS (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 21 Oct 2022 06:36:18 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 768091EA563; Fri, 21 Oct 2022 03:36:16 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id f11so3755090wrm.6; Fri, 21 Oct 2022 03:36:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=sBF0+eXXDy0WFwTI1/e0oRNDrvv6x7YYh8atYvH+z4U=; b=GqBimMsUY9QeEFhS8koHgIAWAQRORXeOnL/tcWTXAnmpx7SgHxmJ4l7gIo/4wF53m1 OHPxRF/F+5axN5OLsjGtjURSxXb2LBFjt7kyFJCWfnzm05kHKYrcbt+Kg3+7vqJKKnMH nBz7skIGk53dYk81h4GMbDu99EX6Rqir8DymdeY7NeH7lxZBv0SS8rY0OBGvIt4pC/oj PIxo2JMro+HDCt/MWI8IFoMk0ZjG0J+RZIVsSMY/xUZO7h8vETQ7I8xZBgqGtawI4sNp eHW3GSVFWamvtR5eWfjfLjTe3XYy3eQ+1ER4jrUUnY5cJhG9Ri6Cx+1r6UL77f1uL/Wu l32g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sBF0+eXXDy0WFwTI1/e0oRNDrvv6x7YYh8atYvH+z4U=; b=fP1lrGPFS8Cq9N4kJr9qxlDZXwSXadz9mDCFZ03fh5ic+uw5gIbcRomgf/c+70Rk5n zhbfCxbIa1vdFG2Z6vtIcTlKYx8vYqbaCPdbWTqFNDUsz5NfNhb1UvndiN7cACnSpQsU 9hsEY4OLyoQ5rjbUEaij45Sr2oEZQfxT56RDdhibLXlKoUP9AoOM4YDaxQv9d+XVzZUu PxXAumZFCZuz45yMepnd1urVdO/1DzRuQXrwxqizm4Rhr6XurSw2Sau07IycSsaGZLkb nNAG7YcHVLd38lWmiZSmaaw85Naq0EndZxre/1Zw+mAIgMzh6kKCm32LcywQJGqTmG+7 iwDA== X-Gm-Message-State: ACrzQf1SIV2T8JDhnzxKjHHhvUtzlh6RBeDZH7ogL8xkehy05DL3rrl6 /quAVbKVgHfEAcNVup3yYuU= X-Received: by 2002:a5d:5b1f:0:b0:22e:51b0:2837 with SMTP id bx31-20020a5d5b1f000000b0022e51b02837mr11881833wrb.132.1666348574359; Fri, 21 Oct 2022 03:36:14 -0700 (PDT) Received: from 127.0.0.1localhost.com ([2620:10d:c092:600::2:f27e]) by smtp.gmail.com with ESMTPSA id e14-20020a5d65ce000000b0022abcc1e3cesm18544759wrw.116.2022.10.21.03.36.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 03:36:13 -0700 (PDT) From: Pavel Begunkov <asml.silence@gmail.com> To: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>, Pavel Begunkov <asml.silence@gmail.com> Subject: [PATCH for-next v3 0/3] implement pcpu bio caching for IRQ I/O Date: Fri, 21 Oct 2022 11:34:04 +0100 Message-Id: <cover.1666347703.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747293655474314827?= X-GMAIL-MSGID: =?utf-8?q?1747293655474314827?= |
Series |
implement pcpu bio caching for IRQ I/O
|
|
Message
Pavel Begunkov
Oct. 21, 2022, 10:34 a.m. UTC
Add bio pcpu caching for normal / IRQ-driven I/O extending REQ_ALLOC_CACHE, which was limited to iopoll. t/io_uring with an Optane SSD setup showed +7% for batches of 32 requests and +4.3% for batches of 8. IRQ, 128/32/32, cache off IOPS=59.08M, BW=28.84GiB/s, IOS/call=31/31 IOPS=59.30M, BW=28.96GiB/s, IOS/call=32/32 IOPS=59.97M, BW=29.28GiB/s, IOS/call=31/31 IOPS=59.92M, BW=29.26GiB/s, IOS/call=32/32 IOPS=59.81M, BW=29.20GiB/s, IOS/call=32/31 IRQ, 128/32/32, cache on IOPS=64.05M, BW=31.27GiB/s, IOS/call=32/31 IOPS=64.22M, BW=31.36GiB/s, IOS/call=32/32 IOPS=64.04M, BW=31.27GiB/s, IOS/call=31/31 IOPS=63.16M, BW=30.84GiB/s, IOS/call=32/32 IRQ, 32/8/8, cache off IOPS=50.60M, BW=24.71GiB/s, IOS/call=7/8 IOPS=50.22M, BW=24.52GiB/s, IOS/call=8/7 IOPS=49.54M, BW=24.19GiB/s, IOS/call=8/8 IOPS=50.07M, BW=24.45GiB/s, IOS/call=7/7 IOPS=50.46M, BW=24.64GiB/s, IOS/call=8/8 IRQ, 32/8/8, cache on IOPS=51.39M, BW=25.09GiB/s, IOS/call=8/7 IOPS=52.52M, BW=25.64GiB/s, IOS/call=7/8 IOPS=52.57M, BW=25.67GiB/s, IOS/call=8/8 IOPS=52.58M, BW=25.67GiB/s, IOS/call=8/7 IOPS=52.61M, BW=25.69GiB/s, IOS/call=8/8 The next step will be turning it on for other users, hopefully by default. The only restriction we currently have is that the allocations can't be done from non-irq context and so needs auditing. note: needs "bio: safeguard REQ_ALLOC_CACHE bio put" missing in for-6.2/block v2: fix botched splicing threshold checks v3: remove merged patch limit scope of flags var in bio_put_percpu_cache (Christoph Hellwig) Pavel Begunkov (3): bio: split pcpu cache part of bio_put into a helper block/bio: add pcpu caching for non-polling bio_put io_uring/rw: enable bio caches for IRQ rw block/bio.c | 93 +++++++++++++++++++++++++++++++++++++++------------ io_uring/rw.c | 3 +- 2 files changed, 74 insertions(+), 22 deletions(-)
Comments
On Fri, Oct 21, 2022 at 11:34:04AM +0100, Pavel Begunkov wrote: >Add bio pcpu caching for normal / IRQ-driven I/O extending REQ_ALLOC_CACHE, >which was limited to iopoll. So below comment (stating process context as MUST) can also be removed as part of this series now? 495 * If REQ_ALLOC_CACHE is set, the final put of the bio MUST be done from process 496 * context, not hard/soft IRQ. 497 * 498 * Returns: Pointer to new bio on success, NULL on failure. 499 */ 500 struct bio *bio_alloc_bioset(struct block_device *bdev, unsigned short nr_vecs, 501 blk_opf_t opf, gfp_t gfp_mask, 502 struct bio_set *bs) 503 { >t/io_uring with an Optane SSD setup showed +7% >for batches of 32 requests and +4.3% for batches of 8. > >IRQ, 128/32/32, cache off >IOPS=59.08M, BW=28.84GiB/s, IOS/call=31/31 >IOPS=59.30M, BW=28.96GiB/s, IOS/call=32/32 >IOPS=59.97M, BW=29.28GiB/s, IOS/call=31/31 >IOPS=59.92M, BW=29.26GiB/s, IOS/call=32/32 >IOPS=59.81M, BW=29.20GiB/s, IOS/call=32/31 > >IRQ, 128/32/32, cache on >IOPS=64.05M, BW=31.27GiB/s, IOS/call=32/31 >IOPS=64.22M, BW=31.36GiB/s, IOS/call=32/32 >IOPS=64.04M, BW=31.27GiB/s, IOS/call=31/31 >IOPS=63.16M, BW=30.84GiB/s, IOS/call=32/32 > >IRQ, 32/8/8, cache off >IOPS=50.60M, BW=24.71GiB/s, IOS/call=7/8 >IOPS=50.22M, BW=24.52GiB/s, IOS/call=8/7 >IOPS=49.54M, BW=24.19GiB/s, IOS/call=8/8 >IOPS=50.07M, BW=24.45GiB/s, IOS/call=7/7 >IOPS=50.46M, BW=24.64GiB/s, IOS/call=8/8 > >IRQ, 32/8/8, cache on >IOPS=51.39M, BW=25.09GiB/s, IOS/call=8/7 >IOPS=52.52M, BW=25.64GiB/s, IOS/call=7/8 >IOPS=52.57M, BW=25.67GiB/s, IOS/call=8/8 >IOPS=52.58M, BW=25.67GiB/s, IOS/call=8/7 >IOPS=52.61M, BW=25.69GiB/s, IOS/call=8/8 > >The next step will be turning it on for other users, hopefully by default. >The only restriction we currently have is that the allocations can't be >done from non-irq context and so needs auditing. Isn't allocation (of bio) happening in non-irq context already? And Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
On 10/25/22 14:25, Kanchan Joshi wrote: > On Fri, Oct 21, 2022 at 11:34:04AM +0100, Pavel Begunkov wrote: >> Add bio pcpu caching for normal / IRQ-driven I/O extending REQ_ALLOC_CACHE, >> which was limited to iopoll. > > So below comment (stating process context as MUST) can also be removed as > part of this series now? Right, good point > 495 * If REQ_ALLOC_CACHE is set, the final put of the bio MUST be done from process > 496 * context, not hard/soft IRQ. > 497 * > 498 * Returns: Pointer to new bio on success, NULL on failure. > 499 */ > 500 struct bio *bio_alloc_bioset(struct block_device *bdev, unsigned short nr_vecs, > 501 blk_opf_t opf, gfp_t gfp_mask, > 502 struct bio_set *bs) > 503 { [...] >> The next step will be turning it on for other users, hopefully by default. >> The only restriction we currently have is that the allocations can't be >> done from non-irq context and so needs auditing. > > Isn't allocation (of bio) happening in non-irq context already? That's my assumption, true for most of them, but I need to actually check that. Will be following up after this series is merged. > Reviewed-by: Kanchan Joshi <joshi.k@samsung.com> thanks
On Fri, 21 Oct 2022 11:34:04 +0100, Pavel Begunkov wrote: > Add bio pcpu caching for normal / IRQ-driven I/O extending REQ_ALLOC_CACHE, > which was limited to iopoll. t/io_uring with an Optane SSD setup showed +7% > for batches of 32 requests and +4.3% for batches of 8. > > IRQ, 128/32/32, cache off > IOPS=59.08M, BW=28.84GiB/s, IOS/call=31/31 > IOPS=59.30M, BW=28.96GiB/s, IOS/call=32/32 > IOPS=59.97M, BW=29.28GiB/s, IOS/call=31/31 > IOPS=59.92M, BW=29.26GiB/s, IOS/call=32/32 > IOPS=59.81M, BW=29.20GiB/s, IOS/call=32/31 > > [...] Applied, thanks! [1/3] bio: split pcpu cache part of bio_put into a helper commit: 0b0735a8c24f006d2d9d8b2b408b8c90f3163abd [2/3] block/bio: add pcpu caching for non-polling bio_put commit: 13a184e269656994180e8c64ff56db03ed737902 [3/3] io_uring/rw: enable bio caches for IRQ rw commit: 93dad04746ea1340dec267f0e98ac42e8bc67160 Best regards,