Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp511868lqs; Thu, 13 Jun 2024 18:09:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUjPvQO+zNr5jSS2vDnmJT1asUm3TRzfOyrgMZsZ6VJEDGrtvAD7Gpd7A6gJj8I2gamoGws/m/v0D0sYVBV2jGt6tmQXIDEwIR0AOY+gA== X-Google-Smtp-Source: AGHT+IEp7WmGaiOqCwuac5b9/OvPf/DHJHSSAdGCkU0BMzxAR4UR3nGy3t0sGaVJF2fI3dgpZovQ X-Received: by 2002:a05:6808:1282:b0:3d2:4fe3:50ed with SMTP id 5614622812f47-3d24fe35492mr965065b6e.59.1718327374281; Thu, 13 Jun 2024 18:09:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718327374; cv=pass; d=google.com; s=arc-20160816; b=EHrhsL4fjQg5YGXrr0DW5y/U4rsvD1TnqzvvIUxRcxw5sC+Ogwf78xf6vs81E5Q1iR V+JvWUwQGg+ICp8OTcOeBJ5hiYAPqsvFWGaPkyqZUXfobwqmcXRtlhF5YIJPD/iV5uCO HDriaFv4PEA0G0lqFJEEIvPCFGCdImLaGEsS8k3XQUCavDg0MGjS2+HEDFsd6AvkTwcC AJTQSU2hE1WGgIPw0Kd4ktk8EqET8tlF3kxhFTSxqBqm9M4buMFERbhE8bpOTNT2M8Pp DMUn7SA+HALUeFwdlerfhNWWxe5ntdKJd4BA9GHrAtSF0bPAEotAKwmhtHVKWlcb41p1 vyIQ== 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=9rBAnW09jIxUd+Ge8hiWrpVm2WBPy+Kjg+s+a5EFD2M=; fh=0hvm9SB3z0eGWBkZimO2GnQ+c1I7s7sKNkl3zf5KBt0=; b=s9ztIm+OSdxxW38KHkw/UqqmwnRVUR84oa0lk7NCKnToeNqxiDehu5HyGqJ3yUc3Cd ry+M3nLkQUt7VSoKBVRQ7gwZMvgVYfBptnLpKZ4jD/8vf1qLW49M4hyUczaGf+e8ARFp +wM3wBxJ4pkd8FYpDkw2us2AIvdHvwUmF1D+a8QR8NmwqYMYa9jywvUJHVNnP7514p5r kjyiLz7y1aiv4t6D0IWbhkZV73oZJe/ds5iRpvuan0Bm81PuYHc+ZWFs/YAjuGU+d4iv 8Q/qsnsJjGCeL5dc62NdtLRg2cYOIwl2oY26MLnAhfJen00+vDxKZeRkduYJWHME/z7U YGYw==; 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-214175-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214175-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-798abe63b72si259377385a.665.2024.06.13.18.09.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 18:09:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214175-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-214175-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214175-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0511F1C21276 for ; Fri, 14 Jun 2024 01:09:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 59BBE158D91; Fri, 14 Jun 2024 01:09:25 +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 CD507158D78; Fri, 14 Jun 2024 01:09:22 +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=1718327364; cv=none; b=XitGEEP0YcE5HOoqrsSxVbO9P89nzs69zR58GAoKezohQddOlnnt2lDXx6lij6FTuxLUAIlJ3ksKxDgk8xw+Q/QLze85JUs6ZfcXVbrMgBJaCN3psZ3dMLc3xhoNio/ixb0wnNee0PeDj/RV0uG4cMPXp8sVjRZVzRP9G7iL4Oc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718327364; c=relaxed/simple; bh=4glP+BRzjyJ2L01GIVKDRo51xwzrVDNk7jCtas8TXlU=; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=aIFQT7e9PHXE91Sly0LmUskL5BDh5tc3MpUBZC7+Tkp/xtci21FruicUdhR+ZfM8UReQ7xufvE0AjriIT+1CUF3PN3556vsk+VaXNab5FJXtgT8qlo+hopuWIrnYItmv2AxxxsFJuuSE7d4Ui0z/fGmC5CXQWjGuVSgEYuWRGMo= 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 4W0h4m2Qpyz4f3jZj; Fri, 14 Jun 2024 09:09:12 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id EF09E1A016E; Fri, 14 Jun 2024 09:09:18 +0800 (CST) Received: from [10.174.176.73] (unknown [10.174.176.73]) by APP1 (Coremail) with SMTP id cCh0CgBHGBE+mGtmdqCtPQ--.28489S3; Fri, 14 Jun 2024 09:09:18 +0800 (CST) Subject: Re: [PATCH -next 2/2] blk-throttle: fix lower control under super low iops limit To: Tejun Heo , Yu Kuai Cc: josef@toxicpanda.com, axboe@kernel.dk, cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com, yangerkun@huawei.com, "yukuai (C)" References: <20240513120848.2828797-1-yukuai1@huaweicloud.com> <20240513120848.2828797-3-yukuai1@huaweicloud.com> From: Yu Kuai Message-ID: Date: Fri, 14 Jun 2024 09:09:18 +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=gbk; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID:cCh0CgBHGBE+mGtmdqCtPQ--.28489S3 X-Coremail-Antispam: 1UD129KBjvdXoW7Gry3ZrW3Cr48try7tFy5urg_yoWDWFb_uF 92k3sakw1UXw4DuanxXFs0yrZa9F45X348Jryqqa1DCFyFkF18Xay3Gr9I9FnxZayfJFnx urs0v3yfCrsrujkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb3kFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j 6F4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oV Cq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUGVWUXwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcVAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628vn2kI c2xKxwCYjI0SjxkI62AI1cAE67vIY487MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4 AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE 17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMI IF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Zr0_Wr1U MIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIda VFxhVjvjDU0xZFpf9x0JUZa9-UUUUU= X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ Hi, ?? 2024/06/14 6:32, Tejun Heo ะด??: > Hello, > > On Mon, May 13, 2024 at 08:08:48PM +0800, Yu Kuai wrote: > ... >> However, if limit is quite low, the result can be 0, then >> allowed IO in the slice is 0, this will cause missing dispatch and >> control will be lower than limit. >> >> For example, set iops_limit to 5 with HD disk, and test will found that >> iops will be 3. > > Hmm... can't this be solved by starting the next slice with the right > credit? Of course, this looks like feasible. I'll look into this. > >> static unsigned int tg_throtl_slice(struct throtl_grp *tg, int rw) >> { >> + if (tg->throtl_slice[rw]) >> + return tg->throtl_slice[rw]; >> return tg->td->throtl_slice; > > Because this is a bit nasty. If we want to use difference throttling slices > for different cgroups, we might as well do it universally. I do thought about this, however, because different cgroups have different slice start, I convinced myself this is fine to have different slice as well. Thanks, Kuai > > Thanks. >