Skip to contentSkip to conversation

blk-throttle: Fix calculation of max number of WRITES to be dispatched

PATCH Applied Vivek Goyal 2 participants 3 messages Oct 27, 2010 – Nov 15, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 block/blk-throttle.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/blk-throttle.c +1 -1
Index: linux-2.6/block/blk-throttle.c
===================================================================
@@ -645,7 +645,7 @@ static int throtl_dispatch_tg(struct thr
 {
 	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 */
#1 lore raw
Quoted 7 lines · Vivek Goyal

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.

---

Hi Jens,

Do you have any concerns about this patch? If not, can you please apply it.

Thanks
Vivek

Quoted 16 lines
 block/blk-throttle.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/block/blk-throttle.c
===================================================================

block/blk-throttle.c +1 -1
@@ -645,7 +645,7 @@ static int throtl_dispatch_tg(struct thr
 {
 	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 */
Applied
#2 lore raw
Quoted 5 lines · Vivek Goyal
Quoted 4 lines · Vivek Goyal

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.

Quoted 8 lines
Quoted 3 lines

---

Hi Jens,

Do you have any concerns about this patch? If not, can you please apply it.

Applied, thanks.

Signature · 1 line
Jens Axboe