Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp736853ybc; Sat, 16 Nov 2019 07:49:27 -0800 (PST) X-Google-Smtp-Source: APXvYqziYof7bRVfA3X47x8eEbCyUCKU7JPNdzGjxiv17EMei3qxAHa53lKzg/l9yBGdlU9LZXEW X-Received: by 2002:a17:906:3606:: with SMTP id q6mr10416368ejb.307.1573919367242; Sat, 16 Nov 2019 07:49:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573919367; cv=none; d=google.com; s=arc-20160816; b=V+hASA3ABnaLxCLOOT0996ec20qASpKNdvBoFLdnL7BxXS4imn0yPTog+aims8B3qN KiHn1e4t+UtY49Mpk9G3WGi+I057Y2mx2oS5aL/Vakywiyga40dSXsmnaEnNZCd6aPVz QLtUz3t+4YjJPp47yos1viXaKwmHqjTnLq13IrrF05Ss0WuZsN0J2wiQD2YPzE1VBP/K /6hl+GrAg/g1YsG82gcXYV+2domYsNjcUfnQ4z0biojd6jcFYpVY0YxUK1/Qdkste2Tm mk1gRGbdiAHAB7Wko/uraLHSd1HEtgdUAHqSIM8GXPNAOy/UwEdy6gsCno+oIJAo5cXv dL4w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lx/ktz0Ec/dPy+wzaXu12f0fI5kM66q/gmx9DVQk88I=; b=XVyXXp9HfZI0XS8nhc9nH8YoJbRFBpUsIajHZqv95Gx06kPf7EdQ222NfiNy6jkHLh vJscRWj0QIsHAzihZbObgPHUzV3Tz6p64dr2NeNiB6yV5kEgvvg0QYXJfpCuroAhUILv fgcZ8j9Zsg4BOJaeE1KZhXMqybUBQddu1yXc7IkZNEGs3aavQ7bxDbpyIWmCqT8L+gka PqTH2hYXKR6HNH7u0AcIgc119TmdbUGF+QEi8dimZerdk01MPFtYxBo0cel8PYTnmUC8 kdNpHiKPb1O09jaSYpPyputlT1GEXxBFupam0kdY9+hXfYo2LlRP09PC8rwVSqos5Jty ffYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="rDTTG/aZ"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p25si7703619eji.415.2019.11.16.07.49.02; Sat, 16 Nov 2019 07:49:27 -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="rDTTG/aZ"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729080AbfKPPou (ORCPT + 99 others); Sat, 16 Nov 2019 10:44:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:49870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729064AbfKPPor (ORCPT ); Sat, 16 Nov 2019 10:44:47 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C8EF82072D; Sat, 16 Nov 2019 15:44:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573919086; bh=w0/xY84kePr1FeSz8bEq9jbc2HkpuXp4oF3+DxCx8oU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rDTTG/aZIq2/5jXH/1DudVwjMVsMUooueRqkQzOkN+sL5hXqZQcx+bjQTmxgj+E7j 6xz22EChGC+83GY242U9NdHXRyPvWS/lvASRyko4ff4fTAH8wkoFj4A7GJJXxX5xkg T53KgIDPsNdncgF7UOTvznHWLSR3BoTXMy4pPFC0= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ming Lei , Josef Bacik , Jens Axboe , Sasha Levin , linux-block@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 148/237] block: call rq_qos_exit() after queue is frozen Date: Sat, 16 Nov 2019 10:39:43 -0500 Message-Id: <20191116154113.7417-148-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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