All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: call rq_qos_exit() after queue is frozen
@ 2018-10-24 13:18 Ming Lei
  2018-10-31  2:04 ` Ming Lei
  2018-10-31 14:40 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Ming Lei @ 2018-10-24 13:18 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Ming Lei, Josef Bacik

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 <josef@toxicpanda.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 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 3ed60723e242..0a5a6cf5add7 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -785,6 +785,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 3772671cf2bc..d4f1280965b6 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -994,8 +994,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.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] block: call rq_qos_exit() after queue is frozen
  2018-10-24 13:18 [PATCH] block: call rq_qos_exit() after queue is frozen Ming Lei
@ 2018-10-31  2:04 ` Ming Lei
  2018-10-31 14:40 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Ming Lei @ 2018-10-31  2:04 UTC (permalink / raw)
  To: Ming Lei; +Cc: Jens Axboe, linux-block, Josef Bacik

On Wed, Oct 24, 2018 at 9:18 PM Ming Lei <ming.lei@redhat.com> wrote:
>
> 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 <josef@toxicpanda.com>
> Signed-off-by: Ming Lei <ming.lei@redhat.com>
> ---
>  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 3ed60723e242..0a5a6cf5add7 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -785,6 +785,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 3772671cf2bc..d4f1280965b6 100644
> --- a/block/blk-sysfs.c
> +++ b/block/blk-sysfs.c
> @@ -994,8 +994,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.9.5
>

Ping...

-- 
Ming Lei

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] block: call rq_qos_exit() after queue is frozen
  2018-10-24 13:18 [PATCH] block: call rq_qos_exit() after queue is frozen Ming Lei
  2018-10-31  2:04 ` Ming Lei
@ 2018-10-31 14:40 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2018-10-31 14:40 UTC (permalink / raw)
  To: Ming Lei; +Cc: linux-block, Josef Bacik

On 10/24/18 7:18 AM, Ming Lei wrote:
> 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.

Looks good, thanks. Applied for 4.20.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-31 14:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-24 13:18 [PATCH] block: call rq_qos_exit() after queue is frozen Ming Lei
2018-10-31  2:04 ` Ming Lei
2018-10-31 14:40 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.