Re: [PATCH block/for-linus] block: blk-throttle should be drainedregardless of q->elevator

From: Vivek Goyal
Date: Wed Feb 15 2012 - 10:53:32 EST


On Mon, Feb 13, 2012 at 03:40:57PM -0800, Tejun Heo wrote:
> Hello,
>
> On Mon, Feb 13, 2012 at 06:27:42PM -0500, Vivek Goyal wrote:
> > > - /*
> > > - * Drain all requests queued before DEAD marking. The caller might
> > > - * be trying to tear down @q before its elevator is initialized, in
> > > - * which case we don't want to call into draining.
> > > - */
> > > - if (q->elevator)
> > > - blk_drain_queue(q, true);
> > > + /* drain all requests queued before DEAD marking */
> >
> > We have already marked the queue DEAD before we start draining the queue.
> > May be we need to fix the comment.
>
> Hmmm... it actually is correct. It drains all requests which were
> queued before the preceding DEAD marking. ie... it's describing the
> following.
>
> 1. requests queued
> 2. mark q DEAD
> 3. drain requests which were queued before #2. We don't care
> about requests queued after #2.

Ok, thanks. I read the comment wrong. I thought of it as "drain all requests before marking queue DEAD". :-)

Thanks
Vivek
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/