提交 c374f127 编写于 作者: T Tejun Heo 提交者: Jens Axboe

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.
Signed-off-by: NJens Axboe <axboe@suse.de>
Signed-off-by: NTejun Heo <htejun@gmail.com>
上级 9c56187d
......@@ -317,7 +317,7 @@ void __elv_add_request(request_queue_t *q, struct request *rq, int where,
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册