Re: [PATCH] blk-sysfs: Rework documention of __blk_release_queue
From: Jens Axboe
Date: Sun Feb 10 2019 - 10:51:00 EST
On 2/10/19 8:44 AM, Marcos Souza wrote:
> On Sun, Feb 10, 2019, 13:23 Jens Axboe <axboe@xxxxxxxxx <mailto:axboe@xxxxxxxxx> wrote:
> On 2/9/19 11:34 AM, Marcos Paulo de Souza wrote:
> > Ping :)
> > On 1/30/19 11:11 PM, Marcos Paulo de Souza wrote:
> >> The Notes section of the comment was removed, because now
> >> blk_release_queue can only be executed from blk_cleanup_queue (being
> >> called when the q->kobj reaches zero), and also blk_init_queue was removed
> >> in a1ce35fa4985.
> >> Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@xxxxxxxxx <mailto:marcos.souza.org@xxxxxxxxx>>
> >> ---
> >>Â This is basically a v2 of https://lkml.org/lkml/2019/1/14/1098
> >>Â But, I tried to describe when this function is called, removing redundancies.
> >>Â Maybe it would be better placed in blk-core.c, where the q->kobj is initialized
> >>Â with blk_queue_ktype (which .release pointer points to blk_release_queue)?
> >>Â block/blk-sysfs.c | 19 +++++++------------
> >>Â 1 file changed, 7 insertions(+), 12 deletions(-)
> >> diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
> >> index 590d1ef2f961..d4dea9179fa6 100644
> >> --- a/block/blk-sysfs.c
> >> +++ b/block/blk-sysfs.c
> >> @@ -817,21 +817,16 @@ static void blk_free_queue_rcu(struct rcu_head *rcu_head)
> >>Â }
> >>Â /**
> >> - * __blk_release_queue - release a request queue when it is no longer needed
> >> + * __blk_release_queue - release a request queue
> >>Â Â* @work: pointer to the release_work member of the request queue to be released
> >>Â Â*
> >>Â Â* Description:
> >> - *Â Â Âblk_release_queue is the counterpart of blk_init_queue(). It should be
> >> - *Â Â Âcalled when a request queue is being released; typically when a block
> >> - *Â Â Âdevice is being de-registered. Its primary task it to free the queue
> >> - *Â Â Âitself.
> >> - *
> >> - * Notes:
> >> - *Â Â ÂThe low level driver must have finished any outstanding requests first
> >> - *Â Â Âvia blk_cleanup_queue().
> >> - *
> >> - *Â Â ÂAlthough blk_release_queue() may be called with preemption disabled,
> >> - *Â Â Â__blk_release_queue() may sleep.
> >> + *Â Â ÂThis function is called when a block device is being de-registered. The
> >> + *Â Â Âprocess of releasing a request queue starts with blk_cleanup_queue, which
> >> + *Â Â Âset the appropriate flags and the calls blk_put_queue, that decrements
> Thanks foe the review. Do you want me to send a v2?