On Wed, 2017-05-31 at 14:49 -0700, Eduardo Valentin wrote:
> On Wed, May 31, 2017 at 09:45:54PM +0000, Bart Van Assche wrote:
> > On Wed, 2017-05-31 at 14:43 -0700, Eduardo Valentin wrote:
> > > On Wed, May 31, 2017 at 02:30:49PM -0700, Bart Van Assche wrote:
> > > > +static void hctx_show_busy(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 &&
> > > > +           test_bit(REQ_ATOM_STARTED, &rq->atomic_flags))
> > > > +               __blk_mq_debugfs_rq_show(params->m,
> > > > +                                        list_entry_rq(&rq->queuelist));
> > > > +}
> > > > +
> > > > +static int hctx_busy_show(void *data, struct seq_file *m)
> > > > +{
> > > > +       struct blk_mq_hw_ctx *hctx = data;
> > > > +       struct show_busy_params params = { .m = m, .hctx = hctx };
> > > > +
> > > > +       blk_mq_tagset_busy_iter(hctx->queue->tag_set, hctx_show_busy, 
> > > > &params);
> > > > +
> > > > +       return 0;
> > > > +}
> > > 
> > > Why not making the two above one single function?
> > > hctx_busy_show vs. hctx_show_busy seams a bit confusing, and I could not 
> > > see
> > > where they get reused in your patch set..
> > 
> > Hello Eduardo,
> > 
> > If I would open-code blk_mq_tagset_busy_iter() then I would be able to 
> > implement
> > the above two functions as a single function. However, 
> > blk_mq_tagset_busy_iter()
> > expects a function pointer as third argument. That's why the above 
> > functionality
> > has been split over two functions.
> 
> Yeah, my bad here. I misread the functions. But still the naming doesnt seam
> too suggestive? how about s/hctx_show_busy/hctx_busy_entry/g?

Hello Eduardo,

Since that function shows information about a single request, how about
hctx_show_busy_rq()?

Bart.

Reply via email to