All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nilay Shroff <nilay@linux.ibm.com>
To: Yu Kuai <yukuai@fnnas.com>,
	axboe@kernel.dk, linux-block@vger.kernel.org, tj@kernel.org,
	ming.lei@redhat.com
Subject: Re: [PATCH v6 06/13] blk-mq-debugfs: remove blk_mq_debugfs_unregister_rqos()
Date: Tue, 30 Dec 2025 11:03:51 +0530	[thread overview]
Message-ID: <5ca7b3a4-e849-4e59-a56c-7e095b0c93b9@linux.ibm.com> (raw)
In-Reply-To: <20251225103248.1303397-7-yukuai@fnnas.com>



On 12/25/25 4:02 PM, Yu Kuai wrote:
> diff --git a/block/blk-rq-qos.c b/block/blk-rq-qos.c
> index d7ce99ce2e80..85cf74402a09 100644
> --- a/block/blk-rq-qos.c
> +++ b/block/blk-rq-qos.c
> @@ -371,8 +371,4 @@ void rq_qos_del(struct rq_qos *rqos)
>  	if (!q->rq_qos)
>  		blk_queue_flag_clear(QUEUE_FLAG_QOS_ENABLED, q);
>  	blk_mq_unfreeze_queue(q, memflags);
> -
> -	mutex_lock(&q->debugfs_mutex);
> -	blk_mq_debugfs_unregister_rqos(rqos);
> -	mutex_unlock(&q->debugfs_mutex);
>  }

This change looks good overall, but I have one comment:

Do we really need to freeze the queue in rq_qos_del() here? Currently,
rq_qos_del() is only called from blk_iocost_init() and blk_iolatency_init(),
both of which run while holding ->freeze_lock. Given this, it seems
unnecessary for rq_qos_del() to freeze and unfreeze the queue again.
Instead, we could remove the freeze/unfreeze logic from rq_qos_del() and
add a WARN_ON() or assertion to ensure that the caller has already frozen
the queue before invoking it.
Moreover, with the current logic, rq_qos_del() may reverse the locking
order between ->rq_qos_mutex and ->freeze_lock if the caller has not
already acquired ->freeze_lock, which could lead to potential lock
ordering issues.

Thanks,
--Nilay

  reply	other threads:[~2025-12-30  5:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-25 10:32 [PATCH v6 00/13] blk-mq: fix possible deadlocks Yu Kuai
2025-12-25 10:32 ` [PATCH v6 01/13] blk-wbt: factor out a helper wbt_set_lat() Yu Kuai
2025-12-25 10:32 ` [PATCH v6 02/13] blk-wbt: fix possible deadlock to nest pcpu_alloc_mutex under q_usage_counter Yu Kuai
2025-12-30  5:34   ` Nilay Shroff
2025-12-25 10:32 ` [PATCH v6 03/13] blk-mq-debugfs: factor out a helper to register debugfs for all rq_qos Yu Kuai
2025-12-25 10:32 ` [PATCH v6 04/13] blk-rq-qos: fix possible debugfs_mutex deadlock Yu Kuai
2025-12-30  5:35   ` Nilay Shroff
2025-12-25 10:32 ` [PATCH v6 05/13] blk-mq-debugfs: make blk_mq_debugfs_register_rqos() static Yu Kuai
2025-12-25 10:32 ` [PATCH v6 06/13] blk-mq-debugfs: remove blk_mq_debugfs_unregister_rqos() Yu Kuai
2025-12-30  5:33   ` Nilay Shroff [this message]
2025-12-31  5:38     ` Yu Kuai
2025-12-25 10:32 ` [PATCH v6 07/13] blk-mq-debugfs: warn about possible deadlock Yu Kuai
2025-12-30  5:37   ` Nilay Shroff
2025-12-30  6:04   ` kernel test robot
2025-12-30 13:05   ` Nilay Shroff
2025-12-31  5:59     ` Yu Kuai
2025-12-25 10:32 ` [PATCH v6 08/13] blk-throttle: fix possible deadlock for fs reclaim under rq_qos_mutex Yu Kuai
2025-12-25 10:32 ` [PATCH v6 09/13] block/blk-rq-qos: add a new helper rq_qos_add_frozen() Yu Kuai
2025-12-25 10:32 ` [PATCH v6 10/13] blk-wbt: fix incorrect lock order for rq_qos_mutex and freeze queue Yu Kuai
2025-12-25 10:32 ` [PATCH v6 11/13] blk-iocost: " Yu Kuai
2025-12-25 10:32 ` [PATCH v6 12/13] blk-iolatency: " Yu Kuai
2025-12-25 10:32 ` [PATCH v6 13/13] block/blk-rq-qos: cleanup rq_qos_add() Yu Kuai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5ca7b3a4-e849-4e59-a56c-7e095b0c93b9@linux.ibm.com \
    --to=nilay@linux.ibm.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=tj@kernel.org \
    --cc=yukuai@fnnas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.