Skip to content

Commit

Permalink
blk-throttle: Fix calculation of max number of WRITES to be dispatched
Browse files Browse the repository at this point in the history
o Currently we try to dispatch more READS and less WRITES (75%, 25%) in one
  dispatch round. ummy pointed out that there is a bug in max_nr_writes
  calculation. This patch fixes it.

Reported-by: ummy y <[email protected]>
Signed-off-by: Vivek Goyal <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
rhvgoyal authored and Jens Axboe committed Nov 15, 2010
1 parent d69b78b commit c2f6805
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/blk-throttle.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ static int throtl_dispatch_tg(struct throtl_data *td, struct throtl_grp *tg,
{
unsigned int nr_reads = 0, nr_writes = 0;
unsigned int max_nr_reads = throtl_grp_quantum*3/4;
unsigned int max_nr_writes = throtl_grp_quantum - nr_reads;
unsigned int max_nr_writes = throtl_grp_quantum - max_nr_reads;
struct bio *bio;

/* Try to dispatch 75% READS and 25% WRITES */
Expand Down

0 comments on commit c2f6805

Please sign in to comment.