From patchwork Fri Aug 27 12:01:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 503390 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp1197845jab; Fri, 27 Aug 2021 05:07:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMHioZ2rQXTk3z0+Yq1ow76UuWl/Y9riSllhZfdwPQrQH3d9C3ab5H3VSOh3fvynxLwjcc X-Received: by 2002:a50:da47:: with SMTP id a7mr9335645edk.315.1630066027251; Fri, 27 Aug 2021 05:07:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630066027; cv=none; d=google.com; s=arc-20160816; b=tWUBAH/XrDIfb3Nsv/beoXoxqe0B/jW3J4G+yh2nz10hoDuGLYxKl0Tn7o+n/XDTm7 t6ixb5LtcNyszpI6klLHpL6SRFpaehkbC+vbmIt2SHMsUo1Cup+Dn8PDaEHK5Ds03uOQ 7xgNyjuhnTVYJnc6u0buX3NUH/5UgLykmveL0jqXIm3i/kbAKYMCE6lVfgtyymfScxYf RDNRmnLSLSd2BVcftQ+7CQGdEmreMDWaOiFWPoS9XHTmWn8/VqBPkXGmzYX4oQMyNlFJ gWMSILcIwWTDdafcDPO4/oWGBXyuottPUI1elh3et/xR2KjAxBRj/FkHYvyIqktWnvRh qw4A== 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=+QQIwdl/rc4+6A4Yg5pwiWFvchHx3Yrw6P2IOc7/vF0=; b=ut99WPHYQRzYnmXGT0nbZaG2Ti4PCvkfB9/4EVKaMYB9qfsB6ZlgAGgDxv9/IVWDdz G6N5oPTnsSho3oy0ALte1ssBDTzlAsRZQWqYWuTEg0CfeimYHzb1uLS7F9ILnzCcIXys jtXEX3IDwf6+EtQULIhdFQi31N0tgqBJBarm/hptpMFK/vxunroKDe+PJwsFkRMjkoOn 6TdPnLQP9qHMiYCYAW4avPibQydeXjDqIZdZG8IX8W+9scNG1Hf21IXfTeY8Q20Y7L40 LfQpSxaH0usrUq+c2Fnu7mQ31D96vv6gDZj7ewWjGL2SlW8YPKjr5NxllTCmN2qlrcb+ zReg== 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 du10si5674681ejc.547.2021.08.27.05.07.07 for ; Fri, 27 Aug 2021 05:07:07 -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 S245169AbhH0MHy (ORCPT ); Fri, 27 Aug 2021 08:07:54 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3702 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245162AbhH0MHx (ORCPT ); Fri, 27 Aug 2021 08:07:53 -0400 Received: from fraeml739-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Gwz1t0ZZTz67wp5; Fri, 27 Aug 2021 20:05:38 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml739-chm.china.huawei.com (10.206.15.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Fri, 27 Aug 2021 14:07:02 +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; Fri, 27 Aug 2021 13:07:00 +0100 From: John Garry To: CC: , , , , John Garry Subject: [PATCH v3 07/13] blk-mq: Pass driver tags to blk_mq_clear_rq_mapping() Date: Fri, 27 Aug 2021 20:01:58 +0800 Message-ID: <1630065724-69146-8-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1630065724-69146-1-git-send-email-john.garry@huawei.com> References: <1630065724-69146-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) 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 Function blk_mq_clear_rq_mapping() will be used for shared sbitmap tags in future, so pass a driver tags pointer instead of the tagset container and HW queue index. Signed-off-by: John Garry --- block/blk-mq.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) -- 2.26.2 diff --git a/block/blk-mq.c b/block/blk-mq.c index b51d59ec7d7a..556c203e6b7c 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2310,10 +2310,9 @@ static size_t order_to_size(unsigned int order) } /* called before freeing request pool in @tags */ -static void blk_mq_clear_rq_mapping(struct blk_mq_tag_set *set, - struct blk_mq_tags *tags, unsigned int hctx_idx) +static void blk_mq_clear_rq_mapping(struct blk_mq_tags *drv_tags, + struct blk_mq_tags *tags) { - struct blk_mq_tags *drv_tags = set->tags[hctx_idx]; struct page *page; unsigned long flags; @@ -2322,7 +2321,7 @@ static void blk_mq_clear_rq_mapping(struct blk_mq_tag_set *set, unsigned long end = start + order_to_size(page->private); int i; - for (i = 0; i < set->queue_depth; i++) { + for (i = 0; i < drv_tags->nr_tags; i++) { struct request *rq = drv_tags->rqs[i]; unsigned long rq_addr = (unsigned long)rq; @@ -2346,8 +2345,11 @@ static void blk_mq_clear_rq_mapping(struct blk_mq_tag_set *set, void blk_mq_free_rqs(struct blk_mq_tag_set *set, struct blk_mq_tags *tags, unsigned int hctx_idx) { + struct blk_mq_tags *drv_tags; struct page *page; + drv_tags = set->tags[hctx_idx]; + if (tags->static_rqs && set->ops->exit_request) { int i; @@ -2361,7 +2363,7 @@ void blk_mq_free_rqs(struct blk_mq_tag_set *set, struct blk_mq_tags *tags, } } - blk_mq_clear_rq_mapping(set, tags, hctx_idx); + blk_mq_clear_rq_mapping(drv_tags, tags); while (!list_empty(&tags->page_list)) { page = list_first_entry(&tags->page_list, struct page, lru);