Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5992274ybc; Wed, 27 Nov 2019 13:03:20 -0800 (PST) X-Google-Smtp-Source: APXvYqxcnXInZ0ijJySCePzjit3Cdt7pSASpdIvV1vijHyBt3hAUs9tDsh19UzmBWtRi6wp0F/JH X-Received: by 2002:aa7:cf8b:: with SMTP id z11mr34568692edx.294.1574888599869; Wed, 27 Nov 2019 13:03:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574888599; cv=none; d=google.com; s=arc-20160816; b=sCHKQEFAchDM7c7/GZo0cB/9C867n6FoMwl//5dD4+pxyR0+u2/1pA1nASfcvoSb6c Qh+C5xSQ48czmou5zjXiSQX/XjpEScRajszZZufhRiw5p+W5ltB6BR7unA8W9lDZ5gyd EdGz4v+VyGc7mjMeS+ABmy1j6Gdse/PZ4j3AT2/YkcOMddvgwx1aR1zbe/i36msmfvAs u6aA68I+p7T82cS/m8QA8abAvftG2rWTOMQIJclcbTu3B9/p2CUDeCYZ3O2YaSuU6AF+ Nivza9oeh7nI97oEeVvhqoawS+oD2Vn43LeeqtrsU650nUawzDRCil9RmnzDLDMiKKO5 NxvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lx/ktz0Ec/dPy+wzaXu12f0fI5kM66q/gmx9DVQk88I=; b=hSGy0VJUUi3mraMVc7stNmHij+/4HAtP+8ghgohNDDsrbjnFnuzXNnMNgXk0tXhJ+q hI1VgSSq0Fm4Y0u1mIoLlxzfg6+PvQSl8pIhKd23D93RDXeRUOpLPddBEpLm//WjBwRc gZYuGZzm+/XhX2Dws0h6vDgdOc3E17nucB3Pi2pcxybV2HvG4GjdslPw/sUIl8Jf/QTj n8pnFdirmvRT/OKq7qo7PEpGLm1Dq30JeVowOHpTLOldVdU+E844bOmJPeSX8IO4me4p DMIw2H7kq2JzhD0y5r/IrE25dgN/nGuk5C4//x95HmVXEmxGKLyGvfXmSP7ke5Kt8bVC q5bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=o868asB1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dd6si1047871edb.186.2019.11.27.13.02.52; Wed, 27 Nov 2019 13:03:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=o868asB1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729567AbfK0VB7 (ORCPT + 99 others); Wed, 27 Nov 2019 16:01:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:54478 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731806AbfK0VB6 (ORCPT ); Wed, 27 Nov 2019 16:01:58 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 01F7F2084B; Wed, 27 Nov 2019 21:01:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888517; bh=w0/xY84kePr1FeSz8bEq9jbc2HkpuXp4oF3+DxCx8oU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o868asB1Kc7rkBDXn3Uj+c6JmAb4EcXN3BRRA4f1LPBHSX91cXSqjdziq7RE9rR8h +IeQEJYA7jRGZBNxfurTltMHbSTAme61ukaRTzrPowQrsdnCP1Z6SoeSj98FCWLC0m USWihsUHdHlSQE90h98PgJmU75mKCPr/sVJs3gUY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Josef Bacik , Ming Lei , Jens Axboe , Sasha Levin Subject: [PATCH 4.19 165/306] block: call rq_qos_exit() after queue is frozen Date: Wed, 27 Nov 2019 21:30:15 +0100 Message-Id: <20191127203127.492254648@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ming Lei [ Upstream commit c57cdf7a9e51d97a43e29b8f4a04157875104000 ] rq_qos_exit() removes the current q->rq_qos, this action has to be done after queue is frozen, otherwise the IO queue path may never be waken up, then IO hang is caused. So fixes this issue by moving rq_qos_exit() after queue is frozen. Cc: Josef Bacik Signed-off-by: Ming Lei Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/blk-core.c | 3 +++ block/blk-sysfs.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 074ae9376189b..ea33d6abdcfc9 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -784,6 +784,9 @@ void blk_cleanup_queue(struct request_queue *q) * prevent that q->request_fn() gets invoked after draining finished. */ blk_freeze_queue(q); + + rq_qos_exit(q); + spin_lock_irq(lock); queue_flag_set(QUEUE_FLAG_DEAD, q); spin_unlock_irq(lock); diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index bab47a17b96f4..8286640d4d663 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -997,8 +997,6 @@ void blk_unregister_queue(struct gendisk *disk) kobject_del(&q->kobj); blk_trace_remove_sysfs(disk_to_dev(disk)); - rq_qos_exit(q); - mutex_lock(&q->sysfs_lock); if (q->request_fn || (q->mq_ops && q->elevator)) elv_unregister_queue(q); -- 2.20.1