Re: [PATCH 02/11] block: relocate elevator initialized test fromblk_cleanup_queue() to blk_drain_queue()

From: Vivek Goyal
Date: Thu Feb 02 2012 - 15:20:44 EST


On Wed, Feb 01, 2012 at 01:19:07PM -0800, Tejun Heo wrote:
> blk_cleanup_queue() may be called for a queue which doesn't have
> elevator initialized to skip invoking blk_drain_queue().
> blk_drain_queue() will be used for other purposes too and may be
> called for such half-initialized queues from other paths. Move
> q->elevator test into blk_drain_queue().
>
> Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
> Cc: Vivek Goyal <vgoyal@xxxxxxxxxx>
> ---
> block/blk-core.c | 16 +++++++++-------
> 1 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/block/blk-core.c b/block/blk-core.c
> index 1b73d06..ddda1cc 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -359,6 +359,13 @@ EXPORT_SYMBOL(blk_put_queue);
> */
> void blk_drain_queue(struct request_queue *q, bool drain_all)
> {
> + /*
> + * The caller might be trying to tear down @q before its elevator
> + * is initialized, in which case we don't want to call into it.
> + */
> + if (!q->elevator)
> + return;
> +

Shouldn't blk_throtl_drain() be called irrespective of the fact whether
elevator is initilialized or not? On bio based drivers, there will be
no elevator but bios can still be throttled.

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/