Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242301
b: refs/heads/master
c: 04521db
h: refs/heads/master
i:
  242299: f0ea02f
v: v3
  • Loading branch information
Vivek Goyal authored and Jens Axboe committed Mar 22, 2011
1 parent a190fd5 commit b20b789
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9026e521c0da0731eb31f9f9022dd00cc3cd8885
refs/heads/master: 04521db04e9a11e74b0252d222051cb194487f4d
25 changes: 24 additions & 1 deletion trunk/block/blk-throttle.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,15 @@ static void throtl_process_limit_change(struct throtl_data *td)
" riops=%u wiops=%u", tg->bps[READ], tg->bps[WRITE],
tg->iops[READ], tg->iops[WRITE]);

/*
* Restart the slices for both READ and WRITES. It
* might happen that a group's limit are dropped
* suddenly and we don't want to account recently
* dispatched IO with new low rate
*/
throtl_start_new_slice(td, tg, 0);
throtl_start_new_slice(td, tg, 1);

if (throtl_tg_on_rr(tg))
tg_update_disptime(td, tg);
}
Expand Down Expand Up @@ -821,7 +830,8 @@ throtl_schedule_delayed_work(struct throtl_data *td, unsigned long delay)

struct delayed_work *dwork = &td->throtl_work;

if (total_nr_queued(td) > 0) {
/* schedule work if limits changed even if no bio is queued */
if (total_nr_queued(td) > 0 || td->limits_changed) {
/*
* We might have a work scheduled to be executed in future.
* Cancel that and schedule a new one.
Expand Down Expand Up @@ -1002,6 +1012,19 @@ int blk_throtl_bio(struct request_queue *q, struct bio **biop)
/* Bio is with-in rate limit of group */
if (tg_may_dispatch(td, tg, bio, NULL)) {
throtl_charge_bio(tg, bio);

/*
* We need to trim slice even when bios are not being queued
* otherwise it might happen that a bio is not queued for
* a long time and slice keeps on extending and trim is not
* called for a long time. Now if limits are reduced suddenly
* we take into account all the IO dispatched so far at new
* low rate and * newly queued IO gets a really long dispatch
* time.
*
* So keep on trimming slice even if bio is not queued.
*/
throtl_trim_slice(td, tg, rw);
goto out;
}

Expand Down

0 comments on commit b20b789

Please sign in to comment.