From patchwork Sat Jul 14 01:50:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Bo X-Patchwork-Id: 10524293 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4E99F6020A for ; Sat, 14 Jul 2018 01:50:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C143295CE for ; Sat, 14 Jul 2018 01:50:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CB14295F3; Sat, 14 Jul 2018 01:50:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F9C1295CE for ; Sat, 14 Jul 2018 01:50:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731042AbeGNCHX (ORCPT ); Fri, 13 Jul 2018 22:07:23 -0400 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:55942 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729771AbeGNCHX (ORCPT ); Fri, 13 Jul 2018 22:07:23 -0400 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R141e4; CH=green; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e01353; MF=bo.liu@linux.alibaba.com; NM=1; PH=DS; RN=1; SR=0; TI=SMTPD_---0T4ahS3w_1531533009; Received: from localhost(mailfrom:bo.liu@linux.alibaba.com fp:SMTPD_---0T4ahS3w_1531533009) by smtp.aliyun-inc.com(127.0.0.1); Sat, 14 Jul 2018 09:50:09 +0800 From: Liu Bo To: Subject: [PATCH] Block: blk-throttle: skip bad bio counting if io.low is not in use Date: Sat, 14 Jul 2018 09:50:07 +0800 Message-Id: <1531533007-74040-1-git-send-email-bo.liu@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When only io.max is in use, tg->target_latency is set to the default value, if that's the case, bad_bio_cnt is not checking at all, so it makes no sense to check latency and do bad_bio_cnt counting in blk_throtl_bio_endio(). Signed-off-by: Liu Bo --- block/blk-throttle.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 03b63d9aa756..4ac552850686 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -2338,6 +2338,10 @@ void blk_throtl_bio_endio(struct bio *bio) throtl_track_latency(tg->td, bio_issue_size(&bio->bi_issue), bio_op(bio), lat); + /* Skip bad bio counting if latency_target is not set. */ + if (tg->latency_target == DFL_LATENCY_TARGET) + goto out; + if (tg->latency_target && lat >= tg->td->filtered_latency) { int bucket; unsigned int threshold; @@ -2362,6 +2366,7 @@ void blk_throtl_bio_endio(struct bio *bio) tg->bad_bio_cnt /= 2; } +out: blkg_put(tg_to_blkg(tg)); } #endif