blk-wbt.c (d62118b6dd99b8f64350206a6ea6996083b28c9a) | blk-wbt.c (a6f0788ec2881ac14e97ff7fa6a78a807f87b5ba) |
---|---|
1/* 2 * buffered writeback throttling. loosely based on CoDel. We can't drop 3 * packets for IO scheduling, so the logic is something like this: 4 * 5 * - Monitor latencies in a defined window of time. 6 * - If the minimum latency in the above window exceeds some target, increment 7 * scaling step and scale down queue depth by a factor of 2x. The monitoring 8 * window is then shrunk to 100 / sqrt(scaling step + 1). --- 561 unchanged lines hidden (view full) --- 570 finish_wait(&rqw->wait, &wait); 571} 572 573static inline bool wbt_should_throttle(struct rq_wb *rwb, struct bio *bio) 574{ 575 const int op = bio_op(bio); 576 577 /* | 1/* 2 * buffered writeback throttling. loosely based on CoDel. We can't drop 3 * packets for IO scheduling, so the logic is something like this: 4 * 5 * - Monitor latencies in a defined window of time. 6 * - If the minimum latency in the above window exceeds some target, increment 7 * scaling step and scale down queue depth by a factor of 2x. The monitoring 8 * window is then shrunk to 100 / sqrt(scaling step + 1). --- 561 unchanged lines hidden (view full) --- 570 finish_wait(&rqw->wait, &wait); 571} 572 573static inline bool wbt_should_throttle(struct rq_wb *rwb, struct bio *bio) 574{ 575 const int op = bio_op(bio); 576 577 /* |
578 * If not a WRITE (or a discard), do nothing | 578 * If not a WRITE (or a discard or write zeroes), do nothing |
579 */ | 579 */ |
580 if (!(op == REQ_OP_WRITE || op == REQ_OP_DISCARD)) | 580 if (!(op == REQ_OP_WRITE || op == REQ_OP_DISCARD || 581 op == REQ_OP_WRITE_ZEROES)) |
581 return false; 582 583 /* 584 * Don't throttle WRITE_ODIRECT 585 */ 586 if ((bio->bi_opf & (REQ_SYNC | REQ_IDLE)) == (REQ_SYNC | REQ_IDLE)) 587 return false; 588 --- 162 unchanged lines hidden --- | 582 return false; 583 584 /* 585 * Don't throttle WRITE_ODIRECT 586 */ 587 if ((bio->bi_opf & (REQ_SYNC | REQ_IDLE)) == (REQ_SYNC | REQ_IDLE)) 588 return false; 589 --- 162 unchanged lines hidden --- |