Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2660111lqt; Mon, 22 Apr 2024 18:51:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWFmUKX4pUm2r4qRejVqmRv404bsE0Spk2yqnK0aIr9KC2fDCW7Bn0byNsRFWBWHmv7V+V8sU5DVQAv3jJvGLIcDC5Y/2FN78cA0pM9BA== X-Google-Smtp-Source: AGHT+IFQYvV0zA8m9sSBz3IC0Yq6leHDN8APklpEuSBysKWq0w/Xvas+g7rs0zqyc97kWhOiQvfg X-Received: by 2002:a05:6a20:551a:b0:1a7:7d2f:6c01 with SMTP id ko26-20020a056a20551a00b001a77d2f6c01mr11907451pzb.48.1713837086964; Mon, 22 Apr 2024 18:51:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713837086; cv=pass; d=google.com; s=arc-20160816; b=qPtUhS4rghCBxEL9z3EsWFI0+0xy52ZLgZrDYF6b/g8RbZkG0WPFexlbmxFQXa9LfI kXZuEJDeL3fSKEWf99ERYVl4TR9J7lcYOZ0JLhrEi9wIEuICdm4UMZTVMpV6LI1lxTRE 7851Bwu3s9yQ5Njc2WtwBenagk3Nd5h1O+qypqPsay784nWbdMIqcRbMoYSc9hkRCyXN jP2l/b8BIAZ3CayVc8lLHyDvQQ6vyDevnG2nErXXK44cEjNWI9atsg+I2WYXe77yfU/J cZkR0/gToCQX4Mj9RdBBqoM9lU/1+y9yppOib1L4DKRAB2P68OtbJQSb2bJQgOxjsLUv BJxw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:date:message-id:from :references:cc:to:subject; bh=kRxh9vBciYi5WdQf9faDVvAtYSC2ozGwItC8qr2RwKs=; fh=pWp4gpyrAJXtgz7fCJsvwEb9X1GULiv63xkaK2AMqIA=; b=jbPpAeZsATjGvGIsVTE2O6x3BiJCAoud52Cs4l4YGjcgyQ3qbxnQuSjMhtcvVZzja1 ZqnrpDC7bDppLH+pt+XgLdq/pWr66VvKRL/3h6ekvg/YFrnb6Iw6jt/Da77y+77bA0cj ndfoxtHsgHWajtbJGr1Al424U46TYR2G3Tip3K7qSXjkmEdsaCilWe6IF558byN0Xxm4 b+DGykt4iJdyIACZ9eyrEFidY0KEc5UaxWycPD7HHCfD3sT+hJgozopuE4jVSUqvfrsM bFFZD1Y0Jt6ixPxqWlRe0I7wKgdCbJB/FfLCBX9ZSuAY4Xp5rWnpuqnC/8F9Fy6v0pk0 Es2A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-154405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154405-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id fa30-20020a056a002d1e00b006ecd76e92d0si8804814pfb.321.2024.04.22.18.51.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 18:51:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-154405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154405-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B09D3B20E5A for ; Tue, 23 Apr 2024 01:51:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A3B86168BE; Tue, 23 Apr 2024 01:51:06 +0000 (UTC) Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B33CA134A8; Tue, 23 Apr 2024 01:51:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713837066; cv=none; b=hAhP/yv90HTWv8Wul13MCWX9cXk0u3VbaqkoLni8cbZJzUayRZbq0qPjGg9nkw1iqpJRqm66Ei2vtPcIMk2+ySkbCZbQR+96cDKuJhTnN2GBOQKd/BPgaNJWL+4+DQe2Uvv10TbKRYOmd2p58VhWovcBnHzoTlpyeSDB4iMqprw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713837066; c=relaxed/simple; bh=wzuhf0hawkcNBkeWH5LY2+F/ZJYzlObZ/lFVJeFgYAU=; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=t3tD64gFmQTqcAa9ty31wgaqWZYubj6Lz3lXeRynpKucCbGOXD2D2tHXK0jEfFwJCSCOs5kbBJxVvOn4FgooosA6S4/QyhF6YNmYYkb3vMAgg7S9SQ+UzPdCIr4Z1q6+y1rhgx1igZr4cUMiuIiAul5fHeXbfbKT1mEPhr0Z5qE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4VNlSp5jcvz4f3mHG; Tue, 23 Apr 2024 09:50:50 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id E83221A0175; Tue, 23 Apr 2024 09:50:59 +0800 (CST) Received: from [10.174.176.73] (unknown [10.174.176.73]) by APP1 (Coremail) with SMTP id cCh0CgBHGBECFCdm12jXKg--.14969S3; Tue, 23 Apr 2024 09:50:59 +0800 (CST) Subject: Re: [PATCH] blk-throttle: fix repeat limit on bio with BIO_BPS_THROTTLED To: "tj@kernel.org" , Yu Kuai Cc: =?UTF-8?B?5ZGo5rOw5a6H?= , "josef@toxicpanda.com" , "axboe@kernel.dk" , "cgroups@vger.kernel.org" , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "yukuai (C)" References: <20240419120747.38031-1-zhoutaiyu@kuaishou.com> From: Yu Kuai Message-ID: <283462e4-c2d7-8d70-bb0f-61db62a86e02@huaweicloud.com> Date: Tue, 23 Apr 2024 09:50:58 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID:cCh0CgBHGBECFCdm12jXKg--.14969S3 X-Coremail-Antispam: 1UD129KBjvJXoW7KryxJr4UGFWDAw1xXrWfuFg_yoW8Aw48p3 W3Ja1xAr1jyrs7Gw1avw4UXa4FvwsxCrZ8JryrGry2kr98Ga4xtr4xJr4akFnIvFsYkw1j yFn3Xas5Wa95ZrDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkC14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4U JVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gc CE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E 2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJV W8JwACjcxG0xvEwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lc7I2V7IY0VAS07AlzVAY IcxG8wCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14 v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkG c2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI 0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280aVAFwI0_Jr0_ Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjfUoOJ5UU UUU X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ Hi, Tejun! 在 2024/04/23 1:39, tj@kernel.org 写道: > Hello, Yu Kuai. > > On Mon, Apr 22, 2024 at 11:47:41AM +0800, Yu Kuai wrote: >> Hi! >> >> 在 2024/04/22 11:33, 周泰宇 写道: >>> What I want to do here was to set an easy to reach value to BPS_LIMIT (10M/s in this example) and an unable to reach value to IOPS_LIMIT (100000 in this example). >>> >>> >>> Under this setting, the iostat shows that the bps is far less than 10M/s and sometimes is far larger than 10M/s. >> >> Yes, I know this behaviour, and this is because blk-throttle works >> before IO split, and io stats is accounting bps for rq-based disk after >> IO split, if you using Q2C for bps you'll see that bps is stable as >> limit. >> >> Hi, Tejun! >> >> Do you think this *phenomenon* need to be fixed? If so, I don't see a >> easy way other than throttle bio after *IO split*. Perhaps ohter than >> bio merge case, this can be another motivation to move blk-throttle to >> rq_qos_throttle(). > > Yeah, blk-throtl is sitting too early in the pipeline to easily track how > the bios actually get issued. However, given that it's been available for > bio-based drivers for a really long time, I don't think it'd be a good idea > to move it, so iops limit is always going to be a bit unreliable w.r.t. what > actually get issued to the device. So, IMHO, if the oddity is just about how > IOs are counted, I don't think it's a critical problem on its own. Got it, and agreed. Consider that bps limit for Q stage is stable, although iostat can observe bps higher or lower sometimes, overall it should be accurate. Hi, Zhoutaiyu, If you really want to fix this, you must come up with a solution with the respect of FIFO rules, breaking it like this patch is not something we'll accept, breaking fairness and some other flaws. Thanks, Kuai > > Thanks. >