mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 21:33:00 +00:00
block, bfq: reduce write overcharge
When a sync request is dispatched, the queue that contains that request, and all the ancestor entities of that queue, are charged with the number of sectors of the request. In constrast, if the request is async, then the queue and its ancestor entities are charged with the number of sectors of the request, multiplied by an overcharge factor. This throttles the bandwidth for async I/O, w.r.t. to sync I/O, and it is done to counter the tendency of async writes to steal I/O throughput to reads. On the opposite end, the lower this parameter, the stabler I/O control, in the following respect. The lower this parameter is, the less the bandwidth enjoyed by a group decreases - when the group does writes, w.r.t. to when it does reads; - when other groups do reads, w.r.t. to when they do writes. The fixes "block, bfq: always update the budget of an entity when needed" and "block, bfq: readd missing reset of parent-entity service" improved I/O control in bfq to such an extent that it has been possible to revise this overcharge factor downwards. This commit introduces the resulting, new value. Signed-off-by: Paolo Valente <paolo.valente@linaro.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
e02a0aa26b
commit
d5801088a7
@ -187,11 +187,25 @@ static const int bfq_stats_min_budgets = 194;
|
||||
static const int bfq_default_max_budget = 16 * 1024;
|
||||
|
||||
/*
|
||||
* Async to sync throughput distribution is controlled as follows:
|
||||
* when an async request is served, the entity is charged the number
|
||||
* of sectors of the request, multiplied by the factor below
|
||||
* When a sync request is dispatched, the queue that contains that
|
||||
* request, and all the ancestor entities of that queue, are charged
|
||||
* with the number of sectors of the request. In constrast, if the
|
||||
* request is async, then the queue and its ancestor entities are
|
||||
* charged with the number of sectors of the request, multiplied by
|
||||
* the factor below. This throttles the bandwidth for async I/O,
|
||||
* w.r.t. to sync I/O, and it is done to counter the tendency of async
|
||||
* writes to steal I/O throughput to reads.
|
||||
*
|
||||
* The current value of this parameter is the result of a tuning with
|
||||
* several hardware and software configurations. We tried to find the
|
||||
* lowest value for which writes do not cause noticeable problems to
|
||||
* reads. In fact, the lower this parameter, the stabler I/O control,
|
||||
* in the following respect. The lower this parameter is, the less
|
||||
* the bandwidth enjoyed by a group decreases
|
||||
* - when the group does writes, w.r.t. to when it does reads;
|
||||
* - when other groups do reads, w.r.t. to when they do writes.
|
||||
*/
|
||||
static const int bfq_async_charge_factor = 10;
|
||||
static const int bfq_async_charge_factor = 3;
|
||||
|
||||
/* Default timeout values, in jiffies, approximating CFQ defaults. */
|
||||
const int bfq_timeout = HZ / 8;
|
||||
@ -853,16 +867,7 @@ static unsigned long bfq_serv_to_charge(struct request *rq,
|
||||
if (bfq_bfqq_sync(bfqq) || bfqq->wr_coeff > 1)
|
||||
return blk_rq_sectors(rq);
|
||||
|
||||
/*
|
||||
* If there are no weight-raised queues, then amplify service
|
||||
* by just the async charge factor; otherwise amplify service
|
||||
* by twice the async charge factor, to further reduce latency
|
||||
* for weight-raised queues.
|
||||
*/
|
||||
if (bfqq->bfqd->wr_busy_queues == 0)
|
||||
return blk_rq_sectors(rq) * bfq_async_charge_factor;
|
||||
|
||||
return blk_rq_sectors(rq) * 2 * bfq_async_charge_factor;
|
||||
return blk_rq_sectors(rq) * bfq_async_charge_factor;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user