Re: [PATCH V7 2/6] block: tracking request allocation with q_usage_counter

Bart Van Assche
2017-10-02T16:01:41Z

On Sat, 2017-09-30 at 14:12 +0800, Ming Lei wrote:
> @@ -1395,16 +1401,21 @@ static struct request *blk_old_get_request(struct request_queue *q,
> unsigned int op, gfp_t gfp_mask)
> {
> struct request *rq;
> + int ret = 0;
>
> WARN_ON_ONCE(q->mq_ops);
>
> /* create ioc upfront */
> create_io_context(gfp_mask, q->node);
>
> + ret = blk_queue_enter(q, !(gfp_mask & __GFP_DIRECT_RECLAIM));
> + if (ret)
> + return ERR_PTR(ret);

Can the above blk_queue_enter() call block if the REQ_NOWAIT flag has been
set in the op argument and e.g. gfp_mask == GFP_KERNEL? If so, isn't that a
bug?

Bart.