linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: "hch@lst.de" <hch@lst.de>,
	"jthumshirn@suse.de" <jthumshirn@suse.de>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"hare@suse.com" <hare@suse.com>,
	"ming.lei@redhat.com" <ming.lei@redhat.com>
Subject: Re: [PATCH] blk-mq-debugfs: Also show requests that have not yet been started
Date: Wed, 03 Oct 2018 15:51:29 -0700	[thread overview]
Message-ID: <1538607089.205649.36.camel@acm.org> (raw)
In-Reply-To: <06b58979-0496-c583-2c00-ccdbd10e0aa9@kernel.dk>

On Wed, 2018-10-03 at 16:12 -0600, Jens Axboe wrote:
> On 10/3/18 3:42 PM, Bart Van Assche wrote:
> > On Fri, 2018-01-12 at 22:11 +0000, Bart Van Assche wrote:
> > >  /*
> > > + * 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.
> > >   */
> > > @@ -402,7 +408,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));
> > >  }
> > 
> > Hello Jens,
> > 
> > Can you share your opinion about the above patch?
> 
> I just convince myself that the list check is super useful. The request
> could be on any number of lists, either not yet seen by the driver, or
> maybe sitting in dispatch. You're only going to be finding these
> requests if the tag is allocated, which means that it's already in some
> sort of non-idle state.
> 
> So enlighten me why we need the list check at all? Wouldn't it be better
> to simply remove it, and ensure that the debug print includes things
> like list state, rq state, etc?

Hello Jens,

I have tried to leave the list_empty() check out but if I do that then
requests that have the state "idle" (allocated but not yet started) also
show up. I think these should be left out from the output produced by
reading the "busy" attribute because such requests are not interesting
when analyzing an I/O lockup:

nullb0/hctx1/busy:00000000abe67123 {.op=READ, .cmd_flags=, .rq_flags=IO_STAT|STATS, .s
tate=idle, .tag=63, .internal_tag=-1}

Thanks,

Bart.

  reply	other threads:[~2018-10-03 22:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2018-10-03 23:52               ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
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

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=1538607089.205649.36.camel@acm.org \
    --to=bvanassche@acm.org \
    --cc=axboe@kernel.dk \
    --cc=hare@suse.com \
    --cc=hch@lst.de \
    --cc=jthumshirn@suse.de \
    --cc=linux-block@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ming.lei@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).