From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Bart Van Assche To: "eduval@amazon.com" CC: "hch@lst.de" , "ming.lei@redhat.com" , "osandov@fb.com" , "linux-block@vger.kernel.org" , "hare@suse.com" , "axboe@kernel.dk" Subject: Re: [PATCH v2 3/4] blk-mq-debugfs: Show busy requests Date: Wed, 31 May 2017 21:54:11 +0000 Message-ID: <1496267650.2608.19.camel@sandisk.com> References: <20170531213050.30276-1-bart.vanassche@sandisk.com> <20170531213050.30276-4-bart.vanassche@sandisk.com> <20170531214327.GD7903@u40b0340c692b58f6553c.ant.amazon.com> <1496267153.2608.17.camel@sandisk.com> <20170531214955.GA13443@u40b0340c692b58f6553c.ant.amazon.com> In-Reply-To: <20170531214955.GA13443@u40b0340c692b58f6553c.ant.amazon.com> Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 List-ID: 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 re= served) > > > > +{ > > > > + const struct show_busy_params *params =3D data; > > > > + > > > > + if (blk_mq_map_queue(rq->q, rq->mq_ctx->cpu) =3D=3D 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 =3D data; > > > > + struct show_busy_params params =3D { .m =3D m, .hctx =3D hctx }; > > > > + > > > > + blk_mq_tagset_busy_iter(hctx->queue->tag_set, hctx_show_busy, &pa= rams); > > > > + > > > > + return 0; > > > > +} > > >=20 > > > 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.. > >=20 > > Hello Eduardo, > >=20 > > 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_bu= sy_iter() > > expects a function pointer as third argument. That's why the above func= tionality > > has been split over two functions. >=20 > Yeah, my bad here. I misread the functions. But still the naming doesnt s= eam > 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.=