Skip to content

Commit c2f6805

Browse files
rhvgoyalJens Axboe
authored andcommitted
blk-throttle: Fix calculation of max number of WRITES to be dispatched
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 <yummylln@yahoo.com.cn> Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
1 parent d69b78b commit c2f6805

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎block/blk-throttle.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ static int throtl_dispatch_tg(struct throtl_data *td, struct throtl_grp *tg,
645645
{
646646
unsigned int nr_reads = 0, nr_writes = 0;
647647
unsigned int max_nr_reads = throtl_grp_quantum*3/4;
648-
unsigned int max_nr_writes = throtl_grp_quantum - nr_reads;
648+
unsigned int max_nr_writes = throtl_grp_quantum - max_nr_reads;
649649
struct bio *bio;
650650

651651
/* Try to dispatch 75% READS and 25% WRITES */

0 commit comments

Comments
 (0)