From patchwork Mon Sep 13 15:12:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 509785 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp655869jao; Mon, 13 Sep 2021 08:18:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWaf61WjeoTt0HW+3jts0Xnv3k85Fxtx6dFHerh+JZ8cQSD4jmneUHVLnVV7brAgatPtDM X-Received: by 2002:a17:906:38db:: with SMTP id r27mr13341644ejd.338.1631546335697; Mon, 13 Sep 2021 08:18:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631546335; cv=none; d=google.com; s=arc-20160816; b=T1Jg68gT6uJ73bSVK76DrMreRSf5RivzgYggW6w4wJPg+78Ex9OKix9yvlMnNZe+Uc rkO4OYXeLO7vTUh8ntmXRRIrh3qwA2cgWNJHfXVyJsOj1i17PFks+ir1S0TVaYJ1wID/ 25vaMtBvwo4NfnkanTCK9+9EEHYFVJrlxd/Lua4x/VtqZ8iqr82LepEtfjbsedzUWtUB lXwpJQaXFW/Aqsm/TIC/a1v17ps0/OkpnX+oPxtUYarwI29CcedAkNoTAA9BLMN83mWD RpuOR6ZCBOTxVIpl2zowxPJIq0dvqWwV5bvqs2DwIR/j0XISgCQh/4rubM614CMlPHEe po8A== 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=PI1Ld2tpMQlU1ATmdnntkldxyhgRIN91VeHOabteg+s=; b=Kk2s4TbBZDACX4rtzOnEoBfqjYP8I19li6pRTISIc4ORNV1uGI0/LPzmn7N50T5e/Z r8RkNhZdn5ShOtG2ERp8n3la8RjwOG/MJx+IATJDmPpeZURngvqErQ90eVG4Z/RYfY44 48CtHJuJ2FxXfLpwUAnumDD/KRpVYpdoDmgUy0jDWPNVdTcbf9TLb1/oTlRmRZk8yu5+ kKMMCM0xjRiAkiKHqQ8eJau7Lqh6TrU1oKHLxLAIRWZSg9V49vOeoLzoaLEyUJi1ZCdH IBOgjP0vcpc2ID9LlQbFS2Q0BJi1SA4dpYoY+oW3iIpEjasLwUbDk6soXT3xhX8WyOJH t4Ow== 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 c30si7358358ejj.786.2021.09.13.08.18.55 for ; Mon, 13 Sep 2021 08:18:55 -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 S1346776AbhIMPUI (ORCPT ); Mon, 13 Sep 2021 11:20:08 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3779 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346189AbhIMPSw (ORCPT ); Mon, 13 Sep 2021 11:18:52 -0400 Received: from fraeml738-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4H7VQy1DYhz67PfY; Mon, 13 Sep 2021 23:15:22 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml738-chm.china.huawei.com (10.206.15.219) 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:34 +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:32 +0100 From: John Garry To: CC: , , , , John Garry Subject: [PATCH RESEND v3 07/13] blk-mq: Pass driver tags to blk_mq_clear_rq_mapping() Date: Mon, 13 Sep 2021 23:12:24 +0800 Message-ID: <1631545950-56586-8-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 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 Reviewed-by: Hannes Reinecke diff --git a/block/blk-mq.c b/block/blk-mq.c index 47d6ab725bcc..4bae8afdfbe1 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2302,10 +2302,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; @@ -2314,7 +2313,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; @@ -2338,8 +2337,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; @@ -2353,7 +2355,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);