All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blk-mq-debugfs: Also show requests that have not yet been started
@ 2018-01-12 21:52 Bart Van Assche
  2018-01-12 21:55 ` Jens Axboe
  0 siblings, 1 reply; 17+ messages in thread
From: Bart Van Assche @ 2018-01-12 21:52 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, Ming Lei,
	Hannes Reinecke, Johannes Thumshirn, Martin K . Petersen

When debugging e.g. the SCSI timeout handler it is important that
requests that have not yet been started or that already have
completed are also reported through debugfs.

This patch depends on a patch that went upstream recently, namely
commit 14e3062fb185 ("scsi: core: Fix a scsi_show_rq() NULL pointer
dereference").

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
---
 block/blk-mq-debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index 19db3f583bf1..ccd5ef08c3f0 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -402,7 +402,7 @@ static void hctx_show_busy_rq(struct request *rq, void *data, bool reserved)
 	const struct show_busy_params *params = data;
 
 	if (blk_mq_map_queue(rq->q, rq->mq_ctx->cpu) == params->hctx &&
-	    blk_mq_rq_state(rq) != MQ_RQ_IDLE)
+	    list_empty(&rq->queuelist))
 		__blk_mq_debugfs_rq_show(params->m,
 					 list_entry_rq(&rq->queuelist));
 }
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread
* [PATCH] blk-mq-debugfs: Also show requests that have not yet been started
@ 2018-02-12 17:02 Bart Van Assche
  0 siblings, 0 replies; 17+ messages in thread
From: Bart Van Assche @ 2018-02-12 17:02 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, Ming Lei,
	Hannes Reinecke, Johannes Thumshirn, Martin K . Petersen

When debugging e.g. the SCSI timeout handler it is important that
requests that have not yet been started or that already have
completed are also reported through debugfs.

This patch depends on a patch that went upstream in kernel v4.15,
namely commit 14e3062fb185 ("scsi: core: Fix a scsi_show_rq() NULL
pointer dereference").

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
---
 block/blk-mq-debugfs.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index c62a3704515b..bcb64b2f8090 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -401,6 +401,12 @@ struct show_busy_params {
 };
 
 /*
+ * Show "busy" requests - these are the requests owned by the block driver.
+ * The test list_empty(&rq->queuelist) is used to figure out whether or not
+ * a request is owned by the block driver. That test works because the block
+ * layer core uses list_del_init() consistently to remove a request from one
+ * of the request lists.
+ *
  * Note: the state of a request may change while this function is in progress,
  * e.g. due to a concurrent blk_mq_finish_request() call.
  */
@@ -409,7 +415,7 @@ static void hctx_show_busy_rq(struct request *rq, void *data, bool reserved)
 	const struct show_busy_params *params = data;
 
 	if (blk_mq_map_queue(rq->q, rq->mq_ctx->cpu) == params->hctx &&
-	    blk_mq_rq_state(rq) != MQ_RQ_IDLE)
+	    list_empty(&rq->queuelist))
 		__blk_mq_debugfs_rq_show(params->m,
 					 list_entry_rq(&rq->queuelist));
 }
-- 
2.16.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread
* [PATCH] blk-mq-debugfs: Also show requests that have not yet been started
@ 2018-10-04 17:35 Bart Van Assche
  2018-10-05  5:48 ` Hannes Reinecke
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Bart Van Assche @ 2018-10-04 17:35 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, Ming Lei,
	Hannes Reinecke, Johannes Thumshirn, Martin K . Petersen

When debugging e.g. the SCSI timeout handler it is important that
requests that have not yet been started or that already have
completed are also reported through debugfs.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
---
 block/blk-mq-debugfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index a5ea86835fcb..41b86f50d126 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -431,8 +431,7 @@ static void hctx_show_busy_rq(struct request *rq, void *data, bool reserved)
 {
 	const struct show_busy_params *params = data;
 
-	if (blk_mq_map_queue(rq->q, rq->mq_ctx->cpu) == params->hctx &&
-	    blk_mq_rq_state(rq) != MQ_RQ_IDLE)
+	if (blk_mq_map_queue(rq->q, rq->mq_ctx->cpu) == params->hctx)
 		__blk_mq_debugfs_rq_show(params->m,
 					 list_entry_rq(&rq->queuelist));
 }
-- 
2.19.0.605.g01d371f741-goog

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

end of thread, other threads:[~2018-10-08  9:15 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-12 21:52 [PATCH] blk-mq-debugfs: Also show requests that have not yet been started Bart Van Assche
2018-01-12 21:55 ` Jens Axboe
2018-01-12 22:00   ` Bart Van Assche
2018-01-12 22:05     ` Jens Axboe
2018-01-12 22:11       ` Bart Van Assche
2018-10-03 21:42         ` Bart Van Assche
2018-10-03 22:12           ` Jens Axboe
2018-10-03 22:51             ` Bart Van Assche
2018-10-03 23:52               ` Jens Axboe
2018-02-12 17:02 Bart Van Assche
2018-10-04 17:35 Bart Van Assche
2018-10-05  5:48 ` Hannes Reinecke
2018-10-05  7:06 ` Johannes Thumshirn
2018-10-05 14:18 ` Jens Axboe
2018-10-05 22:37   ` Omar Sandoval
2018-10-06  1:13     ` Jens Axboe
2018-10-08  9:15       ` Johannes Thumshirn

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.