From patchwork Sun Oct 30 08:32:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinlong Chen X-Patchwork-Id: 12967 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1700337wru; Sun, 30 Oct 2022 01:39:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6wuk6+NKKJD8O7hWs5bjIHhCrEGA3rHEUKC6RlUZyZcJ59EqYI0HL5uKCz2u8YCJL+OZmH X-Received: by 2002:a17:902:64c1:b0:186:827e:a0da with SMTP id y1-20020a17090264c100b00186827ea0damr8458486pli.94.1667119168277; Sun, 30 Oct 2022 01:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667119168; cv=none; d=google.com; s=arc-20160816; b=Yoq6kGwZWHxz5dioLx3Rc9lTrjYn4DAKCz810+edXPMTnyQPj3BZ7Imj+98RcbB2mo F2KkuMf53XD+GLGnZhJC4jrmxhPqjLTxxLAi2ZX9y8FTldgPO/cnJ12v+pUWiq3SU7l3 pWlRkgxXB4p7dWJg2P5JAt62CWoJnJfNOu/xlqvC1jgt4Rkda03xigL9tQXLILlyu9lV 7TP8gpUq2EvB1tDcE7oAs9MmAUk1eRvWx/ASZ3ig3FL8xh2PvVyCHwYUTYbkY+MzGW4W 3t2eVe1h965WpTo0oECOJIGq9/PxphREIUrbM4BGEsBYOWfAYZu2lmPNFCvs8WJt3rY7 pNzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=qUtkjYiPm2TUCeK/vjcHk7NqxxfR/dNuG/o+LvJyMqA=; b=RX2egeiFNft2PjzMeG5p9qKHOeRb+oPaelRbE6ABtBQKLRTXNTvaQb/5FEtebVBIqg wLobgukQsgpd1j+qXFI7a6ivp3e3hOizScMoiKp5ini1T0nJslSG11VIP99qAqKnQlSa XKyTZwvtSoot3ClU0zXk1Qsq9gxgpK8HFynxsqqrCzq+ZxnJE9CyEWG/hEj+3SVPeHnO 89WRb871fVYaCoqI6P9wuBPG1Kpk/8aKSfl8tG0wPxPQlnQjE5Kuv2NHsFZtgHw6hK3j 20s5Hcr2Q+ZwSsuEOm+rAPMDXfjuizfahnjibzVwZgaklFehdLgYtFyP+gRq3PIDHCNN oHdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n18-20020a170903111200b001786399ba31si5471702plh.590.2022.10.30.01.39.15; Sun, 30 Oct 2022 01:39:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229520AbiJ3Ici (ORCPT + 99 others); Sun, 30 Oct 2022 04:32:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbiJ3Ich (ORCPT ); Sun, 30 Oct 2022 04:32:37 -0400 Received: from zju.edu.cn (mail.zju.edu.cn [61.164.42.155]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0F9081C3; Sun, 30 Oct 2022 01:32:35 -0700 (PDT) Received: from localhost.localdomain (unknown [10.14.30.251]) by mail-app4 (Coremail) with SMTP id cS_KCgAHmtyONl5jK6mfBw--.21945S2; Sun, 30 Oct 2022 16:32:29 +0800 (CST) From: Jinlong Chen To: axboe@kernel.dk Cc: hch@lst.de, bvanassche@acm.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, nickyc975@zju.edu.cn Subject: [PATCH] blk-mq: remove redundant call to blk_freeze_queue_start in blk_mq_destroy_queue Date: Sun, 30 Oct 2022 16:32:12 +0800 Message-Id: <20221030083212.1251255-1-nickyc975@zju.edu.cn> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CM-TRANSID: cS_KCgAHmtyONl5jK6mfBw--.21945S2 X-Coremail-Antispam: 1UD129KBjvdXoW7JF48AFW3Gw48trW5Aw13Arb_yoWDGwc_Wa y8A3WqvFs8GF15ur1YkF1rZFn2k348JFy7GFWDW3srJwn5Aan8Z3y7Cr1rCr45W3yUGasr Wr18Gas7Jr10qjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbs8Fc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AK wVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20x vE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E 87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1lnxkEFVAIw20F6c xK64vIFxWle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2Wl Yx0E2Ix0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbV WUJVW8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1l42xK82IYc2Ij 64vIr41l42xK82IY6x8ErcxFaVAv8VW8uw4UJr1UMxC20s026xCaFVCjc4AY6r1j6r4UMI 8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AK xVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI 8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280 aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43 ZEXa7VU1c4S5UUUUU== X-CM-SenderInfo: qssqjiaqqzq6lmxovvfxof0/1tbiAgYTB1ZdtcKYKQACsf X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748101149231429726?= X-GMAIL-MSGID: =?utf-8?q?1748101149231429726?= The calling relationship in blk_mq_destroy_queue() is as follows: blk_mq_destroy_queue() ... -> blk_queue_start_drain() -> blk_freeze_queue_start() <- called ... -> blk_freeze_queue() -> blk_freeze_queue_start() <- called again -> blk_mq_freeze_queue_wait() ... So there is a redundant call to blk_freeze_queue_start(). Replace blk_freeze_queue() with blk_mq_freeze_queue_wait() to avoid the redundant call. Signed-off-by: Jinlong Chen Reviewed-by: Christoph Hellwig --- block/blk-mq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 4cecf281123f..8ca49530bdf3 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -4005,7 +4005,7 @@ void blk_mq_destroy_queue(struct request_queue *q) blk_queue_flag_set(QUEUE_FLAG_DYING, q); blk_queue_start_drain(q); - blk_freeze_queue(q); + blk_mq_freeze_queue_wait(q); blk_sync_queue(q); blk_mq_cancel_work_sync(q);