From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C6A2C11F68 for ; Fri, 2 Jul 2021 15:09:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2DB1C61405 for ; Fri, 2 Jul 2021 15:09:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2DB1C61405 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MBVBPX2UjMKZ0fl54tLZwNASnpLBhA5dXsmIEVTHdOo=; b=tSjjNl0ZZNEfVd JX61pqGIba1pTwAkS3vYsZu23LZJJcDgRKNS2lGHYGRO4CCtiHp5dITYbEVGGAhpRT9hhY/1Tjg0O 20GYvIU65v5GGH/RxPyfruKE9yaGqXKbd6xj+cnOXkk3YHyD/8/SdVa/ZeApT1CM2dA1NBJooagaa UQ5frCmh0FfkuOOJVJNwDtvML5qM5PbZB20l3KINte/dF4EHQqw3PXK27QWtF7XxOilIzI2QkLdVi 6IcStxX/voeVDEu8BwCWj9gZa4p6UwsjCOJjDVwibpyxQhrpQQAQmeUiqdk0tzxWFAOmQ00mAdWHF Av53sX7WF5fDj30Cu2VA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzKms-003Mqy-VP; Fri, 02 Jul 2021 15:09:02 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzKmY-003Mku-Kh for linux-nvme@lists.infradead.org; Fri, 02 Jul 2021 15:08:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625238521; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PjnTyKQduxkSckGYa3hOK0cjgWLepuCwX86Qpy9cFnY=; b=RCnsKgHHzSWGL3Ns+H0EQDIQXM3pli8CNWIRageFrS9P40FFKof9CD+UElxUJO3LKA1kr4 tJwMISsYrKIh4mVZFpqVp4BO5m21WLDkmtLfRnx8zHbqP6UtelHFLL53vgMNqa2wnHRS8B /5+DTsP99pi7tn7yezRuG+6CWRBqP4U= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-595-cSv2aTFnOuSdCDpeOf_r2w-1; Fri, 02 Jul 2021 11:08:40 -0400 X-MC-Unique: cSv2aTFnOuSdCDpeOf_r2w-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6A584802C89; Fri, 2 Jul 2021 15:08:38 +0000 (UTC) Received: from localhost (ovpn-12-40.pek2.redhat.com [10.72.12.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id C26671001281; Fri, 2 Jul 2021 15:08:33 +0000 (UTC) From: Ming Lei To: Jens Axboe , Christoph Hellwig , "Martin K . Petersen" , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org Cc: Sagi Grimberg , Daniel Wagner , Wen Xiong , John Garry , Hannes Reinecke , Keith Busch , Damien Le Moal , Ming Lei Subject: [PATCH V2 6/6] blk-mq: don't deactivate hctx if managed irq isn't used Date: Fri, 2 Jul 2021 23:05:55 +0800 Message-Id: <20210702150555.2401722-7-ming.lei@redhat.com> In-Reply-To: <20210702150555.2401722-1-ming.lei@redhat.com> References: <20210702150555.2401722-1-ming.lei@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210702_080842_829154_79A6679D X-CRM114-Status: GOOD ( 17.40 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org No need to deactivate one hctx if managed irq isn't used because non-managed irq can be migrated to online cpus. So we don't need to register cpu hotplug handler for CPUHP_AP_BLK_MQ_ONLINE if managed irq isn't used. Given BLK_MQ_F_MANAGED_IRQ is more generic and straightforward, it covers !BLK_MQ_F_STACKING perfectly because managed irq is only used in underlying controller, so remove BLK_MQ_F_STACKING. Signed-off-by: Ming Lei --- block/blk-mq-debugfs.c | 1 - block/blk-mq.c | 4 ++-- drivers/block/loop.c | 2 +- drivers/md/dm-rq.c | 2 +- include/linux/blk-mq.h | 5 ----- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 17f57af3a4d6..3641a16c2910 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -245,7 +245,6 @@ static const char *const hctx_flag_name[] = { HCTX_FLAG_NAME(TAG_QUEUE_SHARED), HCTX_FLAG_NAME(BLOCKING), HCTX_FLAG_NAME(NO_SCHED), - HCTX_FLAG_NAME(STACKING), HCTX_FLAG_NAME(TAG_HCTX_SHARED), HCTX_FLAG_NAME(MANAGED_IRQ), }; diff --git a/block/blk-mq.c b/block/blk-mq.c index 1d45d2922ca7..e672ebd93342 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2636,7 +2636,7 @@ static int blk_mq_hctx_notify_dead(unsigned int cpu, struct hlist_node *node) static void blk_mq_remove_cpuhp(struct blk_mq_hw_ctx *hctx) { - if (!(hctx->flags & BLK_MQ_F_STACKING)) + if (hctx->flags & BLK_MQ_F_MANAGED_IRQ) cpuhp_state_remove_instance_nocalls(CPUHP_AP_BLK_MQ_ONLINE, &hctx->cpuhp_online); cpuhp_state_remove_instance_nocalls(CPUHP_BLK_MQ_DEAD, @@ -2731,7 +2731,7 @@ static int blk_mq_init_hctx(struct request_queue *q, { hctx->queue_num = hctx_idx; - if (!(hctx->flags & BLK_MQ_F_STACKING)) + if (hctx->flags & BLK_MQ_F_MANAGED_IRQ) cpuhp_state_add_instance_nocalls(CPUHP_AP_BLK_MQ_ONLINE, &hctx->cpuhp_online); cpuhp_state_add_instance_nocalls(CPUHP_BLK_MQ_DEAD, &hctx->cpuhp_dead); diff --git a/drivers/block/loop.c b/drivers/block/loop.c index cc0e8c39a48b..02509bc54242 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -2268,7 +2268,7 @@ static int loop_add(struct loop_device **l, int i) lo->tag_set.queue_depth = 128; lo->tag_set.numa_node = NUMA_NO_NODE; lo->tag_set.cmd_size = sizeof(struct loop_cmd); - lo->tag_set.flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_STACKING; + lo->tag_set.flags = BLK_MQ_F_SHOULD_MERGE; lo->tag_set.driver_data = lo; err = blk_mq_alloc_tag_set(&lo->tag_set); diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c index 0dbd48cbdff9..294d4858c067 100644 --- a/drivers/md/dm-rq.c +++ b/drivers/md/dm-rq.c @@ -540,7 +540,7 @@ int dm_mq_init_request_queue(struct mapped_device *md, struct dm_table *t) md->tag_set->ops = &dm_mq_ops; md->tag_set->queue_depth = dm_get_blk_mq_queue_depth(); md->tag_set->numa_node = md->numa_node_id; - md->tag_set->flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_STACKING; + md->tag_set->flags = BLK_MQ_F_SHOULD_MERGE; md->tag_set->nr_hw_queues = dm_get_blk_mq_nr_hw_queues(); md->tag_set->driver_data = md; diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 62fc0393cc3a..d75ab9fd64fc 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -397,11 +397,6 @@ struct blk_mq_ops { enum { BLK_MQ_F_SHOULD_MERGE = 1 << 0, BLK_MQ_F_TAG_QUEUE_SHARED = 1 << 1, - /* - * Set when this device requires underlying blk-mq device for - * completing IO: - */ - BLK_MQ_F_STACKING = 1 << 2, BLK_MQ_F_TAG_HCTX_SHARED = 1 << 3, BLK_MQ_F_MANAGED_IRQ = 1 << 4, BLK_MQ_F_BLOCKING = 1 << 5, -- 2.31.1 _______________________________________________ Linux-nvme mailing list Linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme