blk: elevator unplug thresh hanlding fix
PATCH 1/1 blk: elevator unplug thresh hanlding fix
Hello, Jens.
Hello, Andrew.
This patch fixes q->unplug_thresh condition check in__elv_add_request(). rq.count[READ] + rq.count[WRITE] can increase more than one if another thread has allocated a request after the current request is allocated or in_flight could have changed resulting in larger-than-one change of nrq, thus breaking the threshold mechanism.
drivers/block/elevator.c +1 -1
@@ -352,7 +352,7 @@ void __elv_add_request(request_queue_t *int nrq = q->rq.count[READ ] + q->rq.count[WRITE ] - q->in_flight; -if (nrq == q->unplug_thresh) +if (nrq >= q->unplug_thresh)__generic_unplug_device (q); } }else
Quoted 9 lines · Tejun Heo
Hello, Jens.
Hello, Andrew.This patch fixes
q->unplug_threshcondition check in__elv_add_request(). rq.count[READ] + rq.count[WRITE] can increase more than one if another thread has allocated a request after the current request is allocated orin_flightcould have changed resulting in larger-than-one change of nrq, thus breaking the threshold mechanism.
Looks good, thanks!
Signature · 1 line
Jens Axboe