Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp203081rwb; Mon, 28 Nov 2022 19:20:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf4NDnlrkyMo8UpwYsDmVV2YFzmlItbSHR+Um7Gg0wHy8A1WVxXCOHv2MRuU1vkVGcRhccoi X-Received: by 2002:a62:e309:0:b0:575:799e:bc83 with SMTP id g9-20020a62e309000000b00575799ebc83mr835807pfh.78.1669692035253; Mon, 28 Nov 2022 19:20:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669692035; cv=none; d=google.com; s=arc-20160816; b=lsAieZMXdppL8mNWr+Ld3jkvtagEfnROPbijDOKhhNXIRo8J5wjiNzkrQco4MlCxq8 MHJf4zPuZSnRHcqIfhI3K3Zk+QkPmVEiKxL5y95YrEOFeFB21AatI4pzunXRp9ZzdVPu HVJaPyyYuiMDwq+Qxb7GqF0vj3ruwMWShrUkqh0l2Gaj1y/IHAr3Vje2MlikFaI6aWLa 6zuxOs1byv0wGkhzAQJB/P02GLPtU7PQYFhYyFnN4cOqfaaLV0Uee7Mw6wZDxTBtCnID bBqH7CuMZv8LcevA10/u1o6NcJwToJsP2RsR2Ms3cWk4W+hzWBIhcCuzsQWfhMGiDnqc xWeQ== 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=IEquTkWHMi+Wzx6hPIjS99NLgqZfTbZz9cU1OpEL2mY=; b=gKKKo6Q67AGz6wISFOgnTM5UYqzslRGOBk8ooDJpTGfPrTyUlD9/U0203E7RJS1yUS xo/96/FGinHCrNwrVz1qXW7eJYqEU+Pq7m2w51jms4XKbHm+BEfGL3b7VfDwK3kgVdoz rvar84E3VbNVt32IXK75CdKhuvbYiOPdpYbT5RXP+Dgwvk8GDJDp0IFK4aH9B2QWzvAu rTNjpDVaLXdHcDrFpX9vNfEWmP+UMvBC6Lp6HBTc3G3/6hiRtW9ArZr3aB15iefU2HTJ S+nlzf5xnZPJG6Y301DGH+hH6JtCmnh4N1MyGdGG5hpeUoZi4xkVXYsnu9zLRNs3z/hw BL4Q== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a187-20020a6390c4000000b0047846337046si21090pge.419.2022.11.28.19.20.24; Mon, 28 Nov 2022 19:20:35 -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 S235373AbiK2DCg (ORCPT + 82 others); Mon, 28 Nov 2022 22:02:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235316AbiK2DB7 (ORCPT ); Mon, 28 Nov 2022 22:01:59 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2874E3D92C; Mon, 28 Nov 2022 19:01:58 -0800 (PST) Received: from kwepemi500016.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NLnCy0SkqzRpWf; Tue, 29 Nov 2022 11:01:18 +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; Tue, 29 Nov 2022 11:01:55 +0800 From: Kemeng Shi To: , , CC: , , , Subject: [PATCH v2 09/10] blk-throttle: Use more siutable time_after check for update of slice_start Date: Tue, 29 Nov 2022 11:01:46 +0800 Message-ID: <20221129030147.27400-10-shikemeng@huawei.com> X-Mailer: git-send-email 2.14.1.windows.1 In-Reply-To: <20221129030147.27400-1-shikemeng@huawei.com> References: <20221129030147.27400-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: X-Mailing-List: linux-kernel@vger.kernel.org There is no need to update tg->slice_start[rw] to start when they are equal already. So remove "eq" part of check before update slice_start. Signed-off-by: Kemeng Shi --- block/blk-throttle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 94d850b57462..4c80f2aa1e29 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -645,7 +645,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; -- 2.30.0