All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blk-mq-debugfs: fix device sched directory for default scheduler
@ 2017-10-03 21:57 Omar Sandoval
  2017-10-03 21:59 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Omar Sandoval @ 2017-10-03 21:57 UTC (permalink / raw)
  To: linux-block; +Cc: kernel-team

From: Omar Sandoval <osandov@fb.com>

In blk_mq_debugfs_register(), I remembered to set up the per-hctx sched
directories if a default scheduler was already configured by
blk_mq_sched_init() from blk_mq_init_allocated_queue(), but I didn't do
the same for the device-wide sched directory. Fix it.

Fixes: d332ce091813 ("blk-mq-debugfs: allow schedulers to register debugfs attributes")
Signed-off-by: Omar Sandoval <osandov@fb.com>
---
Based on v4.14-rc3.

 block/blk-mq-debugfs.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index 980e73095643..de294d775acf 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -815,10 +815,14 @@ int blk_mq_debugfs_register(struct request_queue *q)
 		goto err;
 
 	/*
-	 * blk_mq_init_hctx() attempted to do this already, but q->debugfs_dir
+	 * blk_mq_init_sched() attempted to do this already, but q->debugfs_dir
 	 * didn't exist yet (because we don't know what to name the directory
 	 * until the queue is registered to a gendisk).
 	 */
+	if (q->elevator && !q->sched_debugfs_dir)
+		blk_mq_debugfs_register_sched(q);
+
+	/* Similarly, blk_mq_init_hctx() couldn't do this previously. */
 	queue_for_each_hw_ctx(q, hctx, i) {
 		if (!hctx->debugfs_dir && blk_mq_debugfs_register_hctx(q, hctx))
 			goto err;
-- 
2.14.2

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

* Re: [PATCH] blk-mq-debugfs: fix device sched directory for default scheduler
  2017-10-03 21:57 [PATCH] blk-mq-debugfs: fix device sched directory for default scheduler Omar Sandoval
@ 2017-10-03 21:59 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2017-10-03 21:59 UTC (permalink / raw)
  To: Omar Sandoval, linux-block; +Cc: kernel-team

On 10/03/2017 03:57 PM, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@fb.com>
> 
> In blk_mq_debugfs_register(), I remembered to set up the per-hctx sched
> directories if a default scheduler was already configured by
> blk_mq_sched_init() from blk_mq_init_allocated_queue(), but I didn't do
> the same for the device-wide sched directory. Fix it.

Good catch, applied for 4.14.

-- 
Jens Axboe

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

end of thread, other threads:[~2017-10-03 21:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-03 21:57 [PATCH] blk-mq-debugfs: fix device sched directory for default scheduler Omar Sandoval
2017-10-03 21:59 ` 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.