Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223455
b: refs/heads/master
c: d1ae8ff
h: refs/heads/master
i:
  223453: 275f3f5
  223451: eb2282b
  223447: f56dcc3
  223439: 3b02b34
  223423: 31c8376
v: v3
  • Loading branch information
Vivek Goyal authored and Jens Axboe committed Dec 1, 2010
1 parent 1a5edc6 commit 2355060
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5478755616ae2ef1ce144dded589b62b2a50d575
refs/heads/master: d1ae8ffdfaa16b2ab2e9346e81cf0ab6eaaae347
16 changes: 16 additions & 0 deletions trunk/block/blk-throttle.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,12 @@ throtl_start_new_slice(struct throtl_data *td, struct throtl_grp *tg, bool rw)
tg->slice_end[rw], jiffies);
}

static inline void throtl_set_slice_end(struct throtl_data *td,
struct throtl_grp *tg, bool rw, unsigned long jiffy_end)
{
tg->slice_end[rw] = roundup(jiffy_end, throtl_slice);
}

static inline void throtl_extend_slice(struct throtl_data *td,
struct throtl_grp *tg, bool rw, unsigned long jiffy_end)
{
Expand Down Expand Up @@ -391,6 +397,16 @@ throtl_trim_slice(struct throtl_data *td, struct throtl_grp *tg, bool rw)
if (throtl_slice_used(td, tg, rw))
return;

/*
* A bio has been dispatched. Also adjust slice_end. It might happen
* that initially cgroup limit was very low resulting in high
* slice_end, but later limit was bumped up and bio was dispached
* sooner, then we need to reduce slice_end. A high bogus slice_end
* is bad because it does not allow new slice to start.
*/

throtl_set_slice_end(td, tg, rw, jiffies + throtl_slice);

time_elapsed = jiffies - tg->slice_start[rw];

nr_slices = time_elapsed / throtl_slice;
Expand Down

0 comments on commit 2355060

Please sign in to comment.