Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2966785rwb; Wed, 30 Nov 2022 13:25:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf5qjPf4R1POuxWBr+RjiDS+6oxEB4aMBz5idaAUIjSFXlcgBzOUcJyitdKG63F3xCxyBN0H X-Received: by 2002:a63:dd41:0:b0:478:645f:c2fb with SMTP id g1-20020a63dd41000000b00478645fc2fbmr2859884pgj.239.1669843534034; Wed, 30 Nov 2022 13:25:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669843534; cv=none; d=google.com; s=arc-20160816; b=yhybgifBcBcKXiLczwmrPatiS78MTorccZJAC47z8YKDo4CCBh1mE22gTt9lAeKLe7 GnKb1ZAhYFN+/4SKqMjHEKJZeQsv50hnf1shukpYQE1m5qHY9W66GohOUwIxb5mdjS7z ati+sMtnIO1Z8iUTBDHOMwKPQ60bU54dqNun4+bk3Idy+XHpFzdS9llZESbBGMXrsogU /bXgW7+Y5C1JTh0b3LxYaEx8eTcQkR/lSDu3M5XmdzAyD+TvfG0z52TsTNGye6ZkGBrv Em6ai0oK4Se1WD5mRmCKjQj0OCaiMHQYsGDEjoBPbemewmzotuwWmL9GjKygkYeAzA+W MJ0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=7v4d6zaC4L81hfiBNb2Cor9kyL3VqKmV3/kGNvOemQ4=; b=PBYxYGyooTz1TmqLI8hx9BCeTSAqTC0RWKHfOh2gCQth+1Itw8pJDDocA3ou1DigKw E4izK9fSvbzBTkFTQo6Hrdw1JDsA5abZB1cjIVWXRHhhr3+sDrV0tQrG5nBNr3lQkYKL W4zS6ZtItl1TQ2WO0/zB+Au1fmVJEtucQ/PdOt1QH3GVJKgeLWecKScycWN+8r5EpyiX m5NndnjCZF7zL1MJeMwoSNkUP8dm5nXd/gctyHaLmHsmckRTeAup1qawHoRXS7ASDGnH oQPvep+vFTBGFTlAIGoAKuYMNiN44fgBu5XtTFuMmRZdBh2eXcQ70+TKAzATwa2Eot0b 1OKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="KkQfDW/g"; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x184-20020a6386c1000000b00477bbd92cf5si2345803pgd.118.2022.11.30.13.25.23; Wed, 30 Nov 2022 13:25:34 -0800 (PST) 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="KkQfDW/g"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229777AbiK3VJ2 (ORCPT + 83 others); Wed, 30 Nov 2022 16:09:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229770AbiK3VJX (ORCPT ); Wed, 30 Nov 2022 16:09:23 -0500 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92E0288B4F; Wed, 30 Nov 2022 13:09:22 -0800 (PST) Received: by mail-pg1-x530.google.com with SMTP id f3so17243439pgc.2; Wed, 30 Nov 2022 13:09:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=7v4d6zaC4L81hfiBNb2Cor9kyL3VqKmV3/kGNvOemQ4=; b=KkQfDW/gc08jpOQwU7UFqMKS7YNnQ9pn2xJKWk1O/71hBqhVuZvr0RPB+dmEmUL5ye xDpaMQ4XhbVldeIM5DIbTL0SLuUc1TY8tpvitVtwhxyYnuHHzufMBZLcTM0uWv4mUKg9 WcjfkyG6DzHJOhP3nUpI7C0Kx9TooMPDylwUQ2yRjIsK4pbudxvzTQZYkV3I75xd38c8 39fm+Z7m1U8xCTByy7ZY4l0ggq7zbR9Ilgwl6I/3X8P20eJd+68SaFY3ySEWh0o8/tZb V5X8HJayccgkIWTrGUSa2b0gTfKURFTnRcDDQ0h8qJqJV31igDseAKynOE7XcHHBW9Sn eXIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7v4d6zaC4L81hfiBNb2Cor9kyL3VqKmV3/kGNvOemQ4=; b=jrO45cxDPOSn4/0pGRbkIGjsrGpRZ2GgLKRxGwtSXQKBmarXCEb3nw7zLQHEL2D3AO AR1tceYa9wf8xL36mVJ0KLZKqR40aXdG/s6s/RdQadluPszjftS2b4mzKXUCDck3q2rc cm9qrXP00YmDZQj08HcpN7cxCY/Efo9VJPonn9FwY0SONM2wKI4Sk8XkbqeQPpt3jkOJ p5tp52czK1+5WJJKQQDCWQpzOu54POFSrpRw9LXoK13BMibcFsSGdcJoDAm0G8gbHu85 j9BRg03S03uyljkjBARgvNRO8gzQomrTNzQ0gfGRRYOdFbMGxUqzdSwHXc9QgJNjB0mP +wpg== X-Gm-Message-State: ANoB5pmiy+HiWUiV2DhMWT1muG8NNQn8lwNh1OXYMsXqza7L9QlbcV5z HBnW2ba9xUByITQRmjKDACo= X-Received: by 2002:a63:525e:0:b0:477:bca8:1cd9 with SMTP id s30-20020a63525e000000b00477bca81cd9mr31590682pgl.581.1669842562016; Wed, 30 Nov 2022 13:09:22 -0800 (PST) Received: from localhost (2603-800c-1a02-1bae-a7fa-157f-969a-4cde.res6.spectrum.com. [2603:800c:1a02:1bae:a7fa:157f:969a:4cde]) by smtp.gmail.com with ESMTPSA id z17-20020aa79e51000000b0056c3d3f5a8dsm1812338pfq.56.2022.11.30.13.09.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 13:09:21 -0800 (PST) Sender: Tejun Heo Date: Wed, 30 Nov 2022 11:09:20 -1000 From: Tejun Heo To: Kemeng Shi Cc: josef@toxicpanda.com, axboe@kernel.dk, cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 02/10] blk-throttle: Fix that bps of child could exceed bps limited in parent Message-ID: References: <20221129030147.27400-1-shikemeng@huawei.com> <20221129030147.27400-3-shikemeng@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221129030147.27400-3-shikemeng@huawei.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no 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 On Tue, Nov 29, 2022 at 11:01:39AM +0800, Kemeng Shi wrote: > Consider situation as following (on the default hierarchy): > HDD > | > root (bps limit: 4k) > | > child (bps limit :8k) > | > fio bs=8k > Rate of fio is supposed to be 4k, but result is 8k. Reason is as > following: > Size of single IO from fio is larger than bytes allowed in one > throtl_slice in child, so IOs are always queued in child group first. > When queued IOs in child are dispatched to parent group, BIO_BPS_THROTTLED > is set and these IOs will not be limited by tg_within_bps_limit anymore. > Fix this by only set BIO_BPS_THROTTLED when the bio traversed the entire > tree. > > There patch has no influence on situation which is not on the default > hierarchy as each group is a single root group without parent. > > Signed-off-by: Kemeng Shi Acked-by: Tejun Heo -- tejun