From patchwork Mon Sep 13 15:12:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 509777 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp654981jao; Mon, 13 Sep 2021 08:17:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtATrHB5fTTSuZ/p+anvgv5fS06Hf5Fahvl45UZHLN40P9sSv1RJGz3F5BvUrLSrck67dl X-Received: by 2002:ac2:504a:: with SMTP id a10mr6268857lfm.470.1631546268911; Mon, 13 Sep 2021 08:17:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631546268; cv=none; d=google.com; s=arc-20160816; b=VypdK2qXonwKGfIDKspY51eZspNtyIQCSuZo7plHXe/kYIGw0OPAHp2c9ulR7Ljiae X00Odvko7RNqHvJSBohl1SjcRsIEUL31xxn3EnMyfcwp9t4mS+8DHw8vA/t5rMvBjTZ8 cHcF7yOF51BNAjqoPZCNv0lbGOi+lrRAVndJ21pqgUP1lYUchiv0Qmot8qFiFc3frPpA YuvVcz/bdPK+uFECxhfUpDNZ90FqZzMFp7HMUOli/+OJ0rqM/vNs3Lqd3vg80vKwbPzh Ll8v6m0nC+YA4cRQNnnDeEPdYFH3r07BBhGncuSpObOgorJWJm9MgGPbSlGiYHGGHG7v I9uQ== 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=HMVizd3BB5u7IGEsInc3EChgYC+PDf2ewKNJUUfMcaY=; b=V//sm4XxC1PBZKkr6R1/JfxHQhgvsQBG223ifvOrbFIDzqmor+AVB0BVw3lCUMKh9h sIiwXtcrfC8oTurgdbyxfE/+8eMoApt9xSqY0Phke1c/f/3R5PVKGHW93DOifTtSXmjn kvlVKQtrrFZxkXsV+jJ4YMHR5wHYP3sGPVYmOixXjytIGjt4lw3eKcCgP4pPmmgFjKRQ E6aEv3TiLvy9sux5PulIHED6BDO75sJEG4/4orP3yj6tSNm9A/cXSEXNjQUpwnNUStE+ XBeIQHuv6JmXt9G+PLButh904PA/L+ol/dkLxS48gXuhM3NOXWnmAEIHoPaA5uTmubE5 aS4g== 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 18si7608876ejh.282.2021.09.13.08.17.48 for ; Mon, 13 Sep 2021 08:17:48 -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 S1346008AbhIMPTA (ORCPT ); Mon, 13 Sep 2021 11:19:00 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3776 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345730AbhIMPSr (ORCPT ); Mon, 13 Sep 2021 11:18:47 -0400 Received: from fraeml741-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4H7VQs33bQz682vm; Mon, 13 Sep 2021 23:15:17 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml741-chm.china.huawei.com (10.206.15.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 13 Sep 2021 17:17:29 +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.2308.8; Mon, 13 Sep 2021 16:17:27 +0100 From: John Garry To: CC: , , , , John Garry Subject: [PATCH RESEND v3 04/13] blk-mq: Invert check in blk_mq_update_nr_requests() Date: Mon, 13 Sep 2021 23:12:21 +0800 Message-ID: <1631545950-56586-5-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1631545950-56586-1-git-send-email-john.garry@huawei.com> References: <1631545950-56586-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) 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 Reviewed-by: Ming Lei --- block/blk-mq.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.26.2 Reviewed-by: Hannes Reinecke diff --git a/block/blk-mq.c b/block/blk-mq.c index 1a4bb2db30e5..47d6ab725bcc 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -3613,18 +3613,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;