summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2010-11-15 19:32:42 +0100
committerJens Axboe <jaxboe@fusionio.com>2010-11-15 19:32:42 +0100
commitc2f6805d470af369a7337801deeecea800dbfe1c (patch)
tree2381b8c512d611869877adfad3d5e0dfe75e668a /block
parentioprio: grab rcu_read_lock in sys_ioprio_{set,get}() (diff)
downloadlinux-c2f6805d470af369a7337801deeecea800dbfe1c.tar.xz
linux-c2f6805d470af369a7337801deeecea800dbfe1c.zip
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>
Diffstat (limited to 'block')
-rw-r--r--block/blk-throttle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index 56ad4531b412..004be80fd894 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -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 */