[dm-devel] [PATCH 1/2] block: Avoid invoking blk_run_queue() recursively
Bart Van Assche
bvanassche at acm.org
Sat Feb 23 12:34:53 UTC 2013
On 02/22/13 20:01, Jens Axboe wrote:
> That'd be fine. I agree with Tejun that just returning is error prone
> and could cause hard-to-debug hangs or stalls. So something ala
>
> if (blk_queue(dead))
> return;
> else if (q->request_fn_active) {
> blk_delay_queue(q, 0);
> return;
> }
>
> would work. Alternatively, you could mark the queue as needing a re-run,
> so any existing runner of it would notice and clear this flag and re-run
> the queue. But that's somewhat more fragile, and since it isn't a
> hot/performance path, I suspect the simple "just re-run me soon" is good
> enough.
I'm worried that in the device mapper the approach using
blk_delay_queue() could trigger a queue run after the final dm_put().
And I'm also afraid that that approach could trigger several needless
context switches before q->request_fn_active finally drops to zero. So
the approach with the "need re-run" flag seems preferable to me. But
maybe I'm overlooking something ?
Bart.
More information about the dm-devel
mailing list