Message ID | 20221123060401.20392-12-shikemeng@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2617740wrr; Tue, 22 Nov 2022 22:14:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf5uvKGmb79jTsK6y7FHtGHpnJC5Gkz432PMUJlc2gSHCwNnocRg0/j7CZ4Xws88DssR9Zrj X-Received: by 2002:a17:90b:2686:b0:218:bb0a:e295 with SMTP id pl6-20020a17090b268600b00218bb0ae295mr12040289pjb.80.1669184098134; Tue, 22 Nov 2022 22:14:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669184098; cv=none; d=google.com; s=arc-20160816; b=INH317m00ZnoYNM3ccxa8riyUrqZI9CGs0TAXK5Gt81wpL9SA0EqfNKpE+vJn6DOFG kVfHSfpkrK+eX/JSnuz496r6TcfUSAHfxGEtGWtx4TyoLfFEJc1bTHoy6aEETK9spEw2 e8KhssSx0BikGgmqlfDPrrM2rEnAEVDUqvob32ZXLjOz77Vbjs1gj/IadTrW1Zo9sBgg ePosNjhrU5x74z4BiAgYjS38ZCVmNmUp8fTyzIbktfTZkXCtxf7HoAZAk7LUcBnmV6x0 esskeqW+X67HDzCbQIFOQy+jps8OKwPC88BH0dgRQozzgVBv7HtNnrpk6VdIFzcVV1UJ YYgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=vT2669sm5EtsWOgJ8OCjJb4lopW/XJq9uxtQAO/1ajI=; b=PVERjDMAthvzgK2g4hve1A/7+ekZmPW36cKIs0U6r6W3aPhv9vIKBGukDPEFUbKbKb cnnC/sJpbUIYad6s7ZC414tY2c2axG2Aw0JYvGwxcyfI9KCVjRDD4ot9FULv9iU2uPsL xY8hKR0CrPgx9JIDffGX5HF6Z7nYUEhILi7T2/Py8nBffwjcTjGWgn0tbR1k770eedur OU0HBxfSN0yGT4aDSXvcKudyoUt2AWxymTPwUqfSIEA/XOZvXecUT1pYV7EK4qWjzATN Tnrr1sH2fcPU1e1pLYCN9Jg2MFtkYRN1AsktwmoIHAX6TalCdsbEjkKBwMufkOOiaj1O kFdA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r134-20020a632b8c000000b0047063e59929si16042830pgr.836.2022.11.22.22.14.45; Tue, 22 Nov 2022 22:14:58 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235951AbiKWGFC (ORCPT <rfc822;cjcooper78@gmail.com> + 99 others); Wed, 23 Nov 2022 01:05:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235810AbiKWGEP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 23 Nov 2022 01:04:15 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5337729A9; Tue, 22 Nov 2022 22:04:13 -0800 (PST) Received: from kwepemi500016.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4NH9V014sDzJnqw; Wed, 23 Nov 2022 14:00:56 +0800 (CST) Received: from huawei.com (10.174.178.129) by kwepemi500016.china.huawei.com (7.221.188.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 23 Nov 2022 14:04:11 +0800 From: Kemeng Shi <shikemeng@huawei.com> To: <tj@kernel.org>, <josef@toxicpanda.com>, <axboe@kernel.dk> CC: <cgroups@vger.kernel.org>, <linux-block@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <shikemeng@huawei.com> Subject: [PATCH 11/11] blk-throttle: Use more siutable time_after check for update slice_start Date: Wed, 23 Nov 2022 14:04:01 +0800 Message-ID: <20221123060401.20392-12-shikemeng@huawei.com> X-Mailer: git-send-email 2.14.1.windows.1 In-Reply-To: <20221123060401.20392-1-shikemeng@huawei.com> References: <20221123060401.20392-1-shikemeng@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.178.129] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi500016.china.huawei.com (7.221.188.220) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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?1750266384635299564?= X-GMAIL-MSGID: =?utf-8?q?1750266384635299564?= |
Series |
A few bugfix and cleanup patches for blk-throttle
|
|
Commit Message
Kemeng Shi
Nov. 23, 2022, 6:04 a.m. UTC
Use more siutable time_after check for update slice_start
Signed-off-by: Kemeng Shi <shikemeng@huawei.com>
---
block/blk-throttle.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, Nov 23, 2022 at 02:04:01PM +0800, Kemeng Shi wrote:
> Use more siutable time_after check for update slice_start
Why is it more suitable?
on 11/24/2022 2:29 AM, Tejun Heo wrote: > On Wed, Nov 23, 2022 at 02:04:01PM +0800, Kemeng Shi wrote: >> Use more siutable time_after check for update slice_start > > Why is it more suitable? There is no need to assign tg->slice_start[rw] to start when they are equal already. So time_after seems more suitable here.
diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 82fe23e79b4b..69eeff764dee 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -635,7 +635,7 @@ static inline void throtl_start_new_slice_with_credit(struct throtl_grp *tg, * that bandwidth. Do try to make use of that bandwidth while giving * credit. */ - if (time_after_eq(start, tg->slice_start[rw])) + if (time_after(start, tg->slice_start[rw])) tg->slice_start[rw] = start; tg->slice_end[rw] = jiffies + tg->td->throtl_slice;