Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1256545rwb; Tue, 27 Sep 2022 10:22:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4JdFIbtbjz8RRqbKVmb/9+NrtL4HdYqmXDY+hU8CVrlg2uVzAn3fm+daOwHYfVA+1K14IG X-Received: by 2002:a17:902:dac7:b0:179:ee21:22a8 with SMTP id q7-20020a170902dac700b00179ee2122a8mr3324277plx.70.1664299343835; Tue, 27 Sep 2022 10:22:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664299343; cv=none; d=google.com; s=arc-20160816; b=UCaXLVpEZJzFh6OF4EVNs1Ku0j495dnavx+l0/b9fHTSlpmZqTjynqjWiKDhLjLeDq 7bLpxAWqHcT5uQTRgQbZj1/hsUQS2g2qOO5gdLzfU678wu3nRn8BA68nlh+xvhYjUaJa 74qm3mfMRXxEcW1Ayiah/mN7siFIs8bLWRsEcFV0wCPfnq1pO5m1P+UOTYfW9fnUUIrd a4rO1xhkZczOp8a098XVRfYs/tU4RIhZ9j3izRhucPMBgZrmXzNEAZIyVO9DtLMuWntY BPDHAC3pIezOH4ft556n/OKzGV7iI7WS7/BQDKNctOo6bnuzNo/7H+Z/2mtwfUICIYNU 5EPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=F2goyNpyd3IXhayCEGATlVULW4jrbgSh4ZPgZuwoLUY=; b=Vyujyhbj7hbR+solvDjOb1oHpz0I9jWfgQcEdVbrUzq+QCRYPVxK2maQ0wX6gkWDIE RQalwEGpL6v0uktIZrDcgAY74aFkZZyh7t9H4qShFiLYiPQKu6TlUAILLoBcxWmwRi6T qM/fJKqrmzvk+dxQmO+HbisNH7liwSrwEvQcx3b2IXcbScWAm/eWrJTPYNWOYgl8xLi4 WSkSEl5mAr9JVWYqZs4XeIyasYJK3sV+NAE3G6RIEPp8ANtGsv+gK8y7t4qOOyj/yQPh uyBpuWqMRyhFq6Avq2VtianZKFxERrDDDi1LvfXYh04de4Pb+009Pklf1li/+7EsYxkH AxVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VufMgnwF; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b3-20020a170902d50300b00176e9d42441si2545986plg.157.2022.09.27.10.22.10; Tue, 27 Sep 2022 10:22:23 -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=@linaro.org header.s=google header.b=VufMgnwF; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232625AbiI0QjG (ORCPT + 99 others); Tue, 27 Sep 2022 12:39:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231784AbiI0Qiz (ORCPT ); Tue, 27 Sep 2022 12:38:55 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A0711D9839 for ; Tue, 27 Sep 2022 09:38:29 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id lh5so21867325ejb.10 for ; Tue, 27 Sep 2022 09:38:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date; bh=F2goyNpyd3IXhayCEGATlVULW4jrbgSh4ZPgZuwoLUY=; b=VufMgnwF8XYZxQrCy+h78oyt/89LDSA/P6+xgdHgQp1Jb1Wn+VwztMpPMIP+EK7F22 s4v39KDbH5rzEXL0glxq9/BuT9m75v0rHl9dCqBy1alkRvgh4wfDE3AaQ1Ygw6IvtWB3 476zV6duj7KCxwM3Nj2ABXwvPaitFT+jH81XWw/ZVH5JzYgv8nwJesdqsWYhNK5YliG4 8BwhvRCtAAwPf5djmV6BSTu3/+qORqY0uB9d/qGU429lJk/8XRkUAInHp7DE50h+lymT Q5WnKLOMZVHwiMfS5IWtQ5g/R9yAMp8MXt5AI+1yiOlck0dY7NXhVTYub2iTFGgRwrxs nt9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=F2goyNpyd3IXhayCEGATlVULW4jrbgSh4ZPgZuwoLUY=; b=CslVdq5sZVn5EejvVWyiwMuFBASk80jbh5UZJ251l+e9The06vhP/yHU7ZlYz4Uf/3 Eq91/b4c1tXaD3Va2VHE36pwZWaMrNE66/VhYW3XqDbA+5R/vWiG+qV1+s2JE6cWtK7q s6uy2+MQp1YlwwFoHzbRlevVHkJ5eVokswVu5U20T+CcB7nfYu/rYUm25LbRg2np463b 6U+jRUQcOt/fzuubMik8erRz1SGjPSr4jbM7srTqIeycRMx+R9OlkGEcsJB984q9VdYO KubbwuPW/YLL4SJ0xaAfO2PXo6/pgj0eS9Ee/oNwaMCULwrlBbqJS8v59mR4dJ7j8VBm wxkA== X-Gm-Message-State: ACrzQf2THgqovhcWcw/jn2f20EVyrA6cMCVmKydqIDZTD1sRWMAIr6SD bqw8oxvRi5lMUk9leyQOYXEmEQ== X-Received: by 2002:a17:907:3dab:b0:783:4b01:1ffe with SMTP id he43-20020a1709073dab00b007834b011ffemr11507259ejc.107.1664296700560; Tue, 27 Sep 2022 09:38:20 -0700 (PDT) Received: from mbp-di-paolo.station (net-2-37-207-44.cust.vodafonedsl.it. [2.37.207.44]) by smtp.gmail.com with ESMTPSA id z21-20020aa7cf95000000b004575c9db638sm1569057edx.54.2022.09.27.09.38.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Sep 2022 09:38:20 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [patch v11 0/6] support concurrent sync io for bfq on a specail occasion From: Paolo Valente In-Reply-To: <20220916071942.214222-1-yukuai1@huaweicloud.com> Date: Tue, 27 Sep 2022 18:38:18 +0200 Cc: Tejun Heo , axboe@kernel.dk, Jan Kara , cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yi.zhang@huawei.com Content-Transfer-Encoding: quoted-printable Message-Id: <29348B39-94AE-4D76-BD2E-B759056264B6@linaro.org> References: <20220916071942.214222-1-yukuai1@huaweicloud.com> To: Yu Kuai X-Mailer: Apple Mail (2.3445.104.11) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org > Il giorno 16 set 2022, alle ore 09:19, Yu Kuai = ha scritto: >=20 > From: Yu Kuai >=20 > Changes in v11: > - keep the comments in bfq_weights_tree_remove() and move it to the > caller where bfqq can be freed. > - add two followed up cleanup patches. >=20 > Changes in v10: > - Add reviewed-tag for patch 2 >=20 > Changes in v9: > - also update how many bfqqs have pending_reqs bfq_bfqq_move(). > - fix one language in patch 4 > - Add reviewed-tag for patch 1,3,4 >=20 > Changes in v8: > - Instead of using whether bfqq is busy, using whether bfqq has = pending > requests. As Paolo pointed out the former way is problematic. >=20 > Changes in v7: > - fix mismatch bfq_inc/del_busy_queues() and bfqq_add/del_bfqq_busy(), > also retest this patchset on v5.18 to make sure functionality is > correct. > - move the updating of 'bfqd->busy_queues' into new apis >=20 > Changes in v6: > - add reviewed-by tag for patch 1 >=20 > Changes in v5: > - rename bfq_add_busy_queues() to bfq_inc_busy_queues() in patch 1 > - fix wrong definition in patch 1 > - fix spelling mistake in patch 2: leaset -> least > - update comments in patch 3 > - add reviewed-by tag in patch 2,3 >=20 > Changes in v4: > - split bfq_update_busy_queues() to bfq_add/dec_busy_queues(), > suggested by Jan Kara. > - remove unused 'in_groups_with_pending_reqs', >=20 > Changes in v3: > - remove the cleanup patch that is irrelevant now(I'll post it > separately). > - instead of hacking wr queues and using weights tree = insertion/removal, > using bfq_add/del_bfqq_busy() to count the number of groups > (suggested by Jan Kara). >=20 > Changes in v2: > - Use a different approch to count root group, which is much simple. >=20 > Currently, bfq can't handle sync io concurrently as long as they > are not issued from root group. This is because > 'bfqd->num_groups_with_pending_reqs > 0' is always true in > bfq_asymmetric_scenario(). >=20 > The way that bfqg is counted into 'num_groups_with_pending_reqs': >=20 > Before this patchset: > 1) root group will never be counted. > 2) Count if bfqg or it's child bfqgs have pending requests. > 3) Don't count if bfqg and it's child bfqgs complete all the requests. >=20 > After this patchset: > 1) root group is counted. > 2) Count if bfqg has pending requests. > 3) Don't count if bfqg complete all the requests. >=20 > With the above changes, concurrent sync io can be supported if only > one group is activated. >=20 > fio test script(startdelay is used to avoid queue merging): > [global] > filename=3D/dev/sda > allow_mounted_write=3D0 > ioengine=3Dpsync > direct=3D1 > ioscheduler=3Dbfq > offset_increment=3D10g > group_reporting > rw=3Drandwrite > bs=3D4k >=20 > [test1] > numjobs=3D1 >=20 > [test2] > startdelay=3D1 > numjobs=3D1 >=20 > [test3] > startdelay=3D2 > numjobs=3D1 >=20 > [test4] > startdelay=3D3 > numjobs=3D1 >=20 > [test5] > startdelay=3D4 > numjobs=3D1 >=20 > [test6] > startdelay=3D5 > numjobs=3D1 >=20 > [test7] > startdelay=3D6 > numjobs=3D1 >=20 > [test8] > startdelay=3D7 > numjobs=3D1 >=20 > test result: > running fio on root cgroup > v5.18: 112 Mib/s > v5.18-patched: 112 Mib/s >=20 > running fio on non-root cgroup > v5.18: 51.2 Mib/s > v5.18-patched: 112 Mib/s >=20 > Note that I also test null_blk with "irqmode=3D2 > completion_nsec=3D100000000(100ms) hw_queue_depth=3D1", and tests show > that service guarantees are still preserved. >=20 Your patches seem ok to me now (thanks for you contribution and, above = all, for your patience). I have only a high-level concern: what do you = mean when you say that service guarantees are still preserved? What test = did you run exactly? This point is very important to me. I'd like to see = some convincing test with differentiated weights. In case you don't have = other tools for executing such tests quickly, you may want to use the = bandwidth-latency test in my simple S benchmark suite (for which I'm = willing to help). Thanks, Paolo > Previous versions: > RFC: = https://lore.kernel.org/all/20211127101132.486806-1-yukuai3@huawei.com/ > v1: = https://lore.kernel.org/all/20220305091205.4188398-1-yukuai3@huawei.com/ > v2: = https://lore.kernel.org/all/20220416093753.3054696-1-yukuai3@huawei.com/ > v3: = https://lore.kernel.org/all/20220427124722.48465-1-yukuai3@huawei.com/ > v4: = https://lore.kernel.org/all/20220428111907.3635820-1-yukuai3@huawei.com/ > v5: = https://lore.kernel.org/all/20220428120837.3737765-1-yukuai3@huawei.com/ > v6: = https://lore.kernel.org/all/20220523131818.2798712-1-yukuai3@huawei.com/ > v7: = https://lore.kernel.org/all/20220528095020.186970-1-yukuai3@huawei.com/ >=20 >=20 > Yu Kuai (6): > block, bfq: support to track if bfqq has pending requests > block, bfq: record how many queues have pending requests > block, bfq: refactor the counting of 'num_groups_with_pending_reqs' > block, bfq: do not idle if only one group is activated > block, bfq: cleanup bfq_weights_tree add/remove apis > block, bfq: cleanup __bfq_weights_tree_remove() >=20 > block/bfq-cgroup.c | 10 +++++++ > block/bfq-iosched.c | 71 +++++++-------------------------------------- > block/bfq-iosched.h | 30 +++++++++---------- > block/bfq-wf2q.c | 69 ++++++++++++++++++++++++++----------------- > 4 files changed, 76 insertions(+), 104 deletions(-) >=20 > --=20 > 2.31.1 >=20