From patchwork Wed Jul 14 15:06:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 476768 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp659642jao; Wed, 14 Jul 2021 08:11:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSV65Va/ME0xxv1P+56fc1Kusg/xPlCFm2bfa1u1Mkq/zC4XhpSWuA7GFkZw/JxYfsvQu7 X-Received: by 2002:a05:6402:202f:: with SMTP id ay15mr14177041edb.147.1626275493478; Wed, 14 Jul 2021 08:11:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626275493; cv=none; d=google.com; s=arc-20160816; b=DyFeUAsRt315TJ5Jyh1J8JWbc/6B31loYQKby+GGHTKBi9ahP9glDn9hc94FJLox1V ONnhbUl1oZU2brAnm+hMZgz5dsL+9l3/K5LWiabPQakxWwq1VcXexOR36uDDACTCgB1B wmpYudcf34zaVY69SjCnkUy58EzRW9jj7skGKoId0+UgUkpcxAox8Gb2BN8Gs92Pp7av HXfOsL1JnY7uARxnEFND/magc1Ou30hCL9KCZXcsqAZyRLdoQRah9NuL9qjkQ98rLc6t knHFyyN4da5/SM+Z6+qB+GQ7BGDNYxVftQ4VlDw5ln5yRwnkpAe03B1X/36kD/rGG611 ZSzw== 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=blTUjU4czdH6LPf8QpxMg+cRyLpRw88qhy7A/pvWiXs=; b=Ww4cGYdOJDduHwmZ23V7NPHRDePdTepXCkwBKB539XI4NtREzOep1LgADXrYYh0mxb v9UyZdKEpNNRq4QFN8HI0D3A/t0TR9f3EqzC/CtFyoTm+u7THCQM/dU5iEMABvHuG20U dccqYbPSFUP93KvmGO+Tpcsn2YO493sakqkYjqbWJ59GRmh36Nw2wbZwoXmPxCP+PKvP LATZabEN27GW7r6WcCHAvYrPJ9ShH7E7GElvNwEcGRacnX3YX3itOj8joHzm+qrwi/bi JaVzi4ld90j7h4FMHWJP4yNU5/IO8fdGRpMxSW8U57PFA57vhuIi3J1LRSnlfHMfSAIp P3fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f21si2888186ejj.567.2021.07.14.08.11.33 for ; Wed, 14 Jul 2021 08:11:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239635AbhGNPOU (ORCPT ); Wed, 14 Jul 2021 11:14:20 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3408 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239623AbhGNPOR (ORCPT ); Wed, 14 Jul 2021 11:14:17 -0400 Received: from fraeml744-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4GQ0zf6NGwz6L88Y; Wed, 14 Jul 2021 23:00:14 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml744-chm.china.huawei.com (10.206.15.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 14 Jul 2021 17:11:23 +0200 Received: from localhost.localdomain (10.69.192.58) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 14 Jul 2021 16:11:21 +0100 From: John Garry To: CC: , , , , , , John Garry Subject: [PATCH 5/9] blk-mq: Invert check in blk_mq_update_nr_requests() Date: Wed, 14 Jul 2021 23:06:31 +0800 Message-ID: <1626275195-215652-6-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1626275195-215652-1-git-send-email-john.garry@huawei.com> References: <1626275195-215652-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org It's easier to read: if (x) X; else Y; over: if (!x) Y; else X; No functional change intended. Signed-off-by: John Garry --- block/blk-mq.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.26.2 diff --git a/block/blk-mq.c b/block/blk-mq.c index b0d4197d36c7..3ff5c15ce0eb 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -3621,18 +3621,18 @@ int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr) * If we're using an MQ scheduler, just update the scheduler * queue depth. This is similar to what the old code would do. */ - if (!hctx->sched_tags) { - ret = blk_mq_tag_update_depth(hctx, &hctx->tags, nr, - false); - } else { + if (hctx->sched_tags) { ret = blk_mq_tag_update_depth(hctx, &hctx->sched_tags, - nr, true); + nr, true); if (blk_mq_is_sbitmap_shared(set->flags)) { hctx->sched_tags->bitmap_tags = &q->sched_bitmap_tags; hctx->sched_tags->breserved_tags = &q->sched_breserved_tags; } + } else { + ret = blk_mq_tag_update_depth(hctx, &hctx->tags, nr, + false); } if (ret) break;