Message ID | cover.1666122465.git.asml.silence@gmail.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp2133519wrs; Tue, 18 Oct 2022 12:54:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ECkb4CrEJGLH+LPt5vFtHTyuXYyRrv0OOZgxOmAWw8zXzfyJcvt2d2o8z3+Fxv+F39X5t X-Received: by 2002:a17:902:da83:b0:185:5837:f43a with SMTP id j3-20020a170902da8300b001855837f43amr5012043plx.26.1666122845484; Tue, 18 Oct 2022 12:54:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666122845; cv=none; d=google.com; s=arc-20160816; b=UizQ2NQMY2loYjxpUJvdFJoVyEb1saplwPA3sg0HSFzqhMmgkbTYEmaWF0MDBSKHJy yGcRgL23JXBaTpP2Iat9IimuC4ALlH8YWxpRtzlvHPQqfp4kguC6j0jlsli6TW9ReTUN /2blcoUwEY7QwVJivcbHuzmZO0/BBvEF6akTGFT/gGj9j68PIFvRASV9bqtQsYiqFs5g kCAxW60hmOd/qv5T8nvIOunfORiIvDDB51h8eL7MYpLDCJYdMcNIQHtw+Lsu6TOGkv8K UcrTpXuOE1niYhSf7b8VtFwDir6SUuCgdbogw7sc+ytIJkkCZL56aZGhdEBJW5n8u+6R eQ+w== 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=hesUVV8oLfqzPuwApMzbxfjgf/NGsaqcxurto5C/xyU=; b=rieIDPSYPXBNIM0OwIcL8WJVT79qWFWQxotc3EO4FWKit411j1xN7b6gNY01oiJA2x xTzvKCogBk1y8hnTJiDD//MWcRUpTJOoI9YaInt9oCgbxw0QIVJr24XlrQuizh7A0frV hGz36hLO4aLPNLsqZirQfzxcLAcQZoNfSmH/rDjRipPbU8kuAp7pfX5VpbfSmVBgk+79 KT+fudK8bYCabG0bxXn9/GowAGSKEx+/5leKKc8u4Yttqf3IbiJpcwfHhBnfGQv3XWrB /JMDlO7msZBfybc0fWoGQsIRFqZdn9UAZFNthPaVs6bFST4N+xNFxbjkT4H62f4Z/d5n ncfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oM8BEinm; 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 br4-20020a17090b0f0400b001f31c65900dsi19355012pjb.150.2022.10.18.12.53.52; Tue, 18 Oct 2022 12:54:05 -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=oM8BEinm; 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 S229874AbiJRTwk (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Tue, 18 Oct 2022 15:52:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229569AbiJRTwj (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 18 Oct 2022 15:52:39 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 016C58708D; Tue, 18 Oct 2022 12:52:29 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id w18so34892789ejq.11; Tue, 18 Oct 2022 12:52:28 -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=hesUVV8oLfqzPuwApMzbxfjgf/NGsaqcxurto5C/xyU=; b=oM8BEinm+7PCkXNou9ynjD3DYOjnpAZWd+QtEjiMIqOdlLzTTjSroUSFEkrnooNnXh yqjfn7/KUT/pZtJMR8+L1ufMHm9DU1Sz+UqSkzUFc7rHOUniprjb1wnuyX2ETTaJk4WZ JehnGyA30CL+/NV0eXv/5cgm/p3dMhi3Kysan5z+MSOcIC72W+a6Vo8g1o9nN58o+9gT BWLofMj6t1nrd9SeN4cGw3FEcAkZggENHBsOC21hXear5uVQiSKuu5CMy6lMJvALS+NJ keGsRkUy4/TLueAoqywZiV2CnUGgEtXMzOY91Zqnsgkq/YsS87uzkA+GqokWeQ0KJ/3a EeSA== 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=hesUVV8oLfqzPuwApMzbxfjgf/NGsaqcxurto5C/xyU=; b=PUk6dGZ2YDRCWmEvRNouCKcpBYS0GFeC510cyXdutBE/G9XH52TwC2CYdZMKr49kM/ hP49YuuXmpHOO0zYYO4HIzd2HRUrQK7E3R5d2125rSs/qBqvHHxrS5IhCg0pH5JXj7hq JK5QPM/HbpOHzYcvX25Wph4WFc+s39suVOBW6288oqxoth0dgR6GpetB9x5VaKa0gKHI DWyXcdRJHryJTJq3eZ3nZDaJOOIiJ9a6b4kitIdVqcu01sKmbeOWLPwZUxoGWbdhDYkf PP7S+v/UtZ2OXLZGUQyJRk7t+p/xDkFN+jpcbjuOr/VbYDXHmZamcT7ekJ5SZaCiQeUk 4oNw== X-Gm-Message-State: ACrzQf0v8F73TE/1joIed7tjFVA1HJJaKOO3BxnU8Oo2UGUhxNWzzJmc VkzF0VcTTXlgHWGts48kt086bRyCKuM= X-Received: by 2002:a17:907:7287:b0:78d:8f26:5911 with SMTP id dt7-20020a170907728700b0078d8f265911mr3584838ejc.463.1666122723980; Tue, 18 Oct 2022 12:52:03 -0700 (PDT) Received: from 127.0.0.1localhost (94.197.72.2.threembb.co.uk. [94.197.72.2]) by smtp.gmail.com with ESMTPSA id r1-20020a1709061ba100b0072a881b21d8sm7945858ejg.119.2022.10.18.12.52.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 12:52:03 -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, linux-fsdevel@vger.kernel.org, Pavel Begunkov <asml.silence@gmail.com> Subject: [RFC for-next v2 0/4] enable pcpu bio caching for IRQ I/O Date: Tue, 18 Oct 2022 20:50:54 +0100 Message-Id: <cover.1666122465.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?1747052609149355215?= X-GMAIL-MSGID: =?utf-8?q?1747056428662248921?= |
Series |
enable pcpu bio caching for IRQ I/O
|
|
Message
Pavel Begunkov
Oct. 18, 2022, 7:50 p.m. UTC
This series implements bio pcpu caching for normal / IRQ-driven I/O extending REQ_ALLOC_CACHE currently limited to iopoll. The allocation side still only works from non-irq context, which is the reason it's not enabled by default, but turning it on for other users (e.g. filesystems) is as a matter of passing a flag. 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 main part is in patch 3. Would be great to take patch 1 separately for 6.1 for extra safety. v2: fix botched splicing threshold checks Pavel Begunkov (4): bio: safeguard REQ_ALLOC_CACHE bio put 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 | 94 ++++++++++++++++++++++++++++++++++++++++----------- io_uring/rw.c | 3 +- 2 files changed, 76 insertions(+), 21 deletions(-)
Comments
On Tue, Oct 18, 2022 at 08:50:54PM +0100, Pavel Begunkov wrote: > This series implements bio pcpu caching for normal / IRQ-driven I/O > extending REQ_ALLOC_CACHE currently limited to iopoll. The allocation side > still only works from non-irq context, which is the reason it's not enabled > by default, but turning it on for other users (e.g. filesystems) is > as a matter of passing a flag. > > t/io_uring with an Optane SSD setup showed +7% for batches of 32 requests > and +4.3% for batches of 8. This looks much nicer to me than the previous attempt exposing the bio internals to io_uring, thanks.
On 10/20/22 09:32, Christoph Hellwig wrote: > On Tue, Oct 18, 2022 at 08:50:54PM +0100, Pavel Begunkov wrote: >> This series implements bio pcpu caching for normal / IRQ-driven I/O >> extending REQ_ALLOC_CACHE currently limited to iopoll. The allocation side >> still only works from non-irq context, which is the reason it's not enabled >> by default, but turning it on for other users (e.g. filesystems) is >> as a matter of passing a flag. >> >> t/io_uring with an Optane SSD setup showed +7% for batches of 32 requests >> and +4.3% for batches of 8. > > This looks much nicer to me than the previous attempt exposing the bio > internals to io_uring, thanks. Yeah, I saw the one Jens posted before but I wanted this one to be more generic, i.e. applicable not only to io_uring. Thanks for taking a look.
On Tue, 18 Oct 2022 20:50:54 +0100, Pavel Begunkov wrote: > This series implements bio pcpu caching for normal / IRQ-driven I/O > extending REQ_ALLOC_CACHE currently limited to iopoll. The allocation side > still only works from non-irq context, which is the reason it's not enabled > by default, but turning it on for other users (e.g. filesystems) is > as a matter of passing a flag. > > t/io_uring with an Optane SSD setup showed +7% for batches of 32 requests > and +4.3% for batches of 8. > > [...] Applied, thanks! [1/4] bio: safeguard REQ_ALLOC_CACHE bio put commit: d4347d50407daea6237872281ece64c4bdf1ec99 Best regards,
On 10/20/22 5:40 AM, Pavel Begunkov wrote: > On 10/20/22 09:32, Christoph Hellwig wrote: >> On Tue, Oct 18, 2022 at 08:50:54PM +0100, Pavel Begunkov wrote: >>> This series implements bio pcpu caching for normal / IRQ-driven I/O >>> extending REQ_ALLOC_CACHE currently limited to iopoll. The allocation side >>> still only works from non-irq context, which is the reason it's not enabled >>> by default, but turning it on for other users (e.g. filesystems) is >>> as a matter of passing a flag. >>> >>> t/io_uring with an Optane SSD setup showed +7% for batches of 32 requests >>> and +4.3% for batches of 8. >> >> This looks much nicer to me than the previous attempt exposing the bio >> internals to io_uring, thanks. > > Yeah, I saw the one Jens posted before but I wanted this one to be more > generic, i.e. applicable not only to io_uring. Thanks for taking a look. It is indeed better like that, also because we can get rid of the alloc cache flag long term and just have it be the way that bio allocations work.