projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'pnp-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
[cascardo/linux.git]
/
block
/
blk-throttle.c
diff --git
a/block/blk-throttle.c
b/block/blk-throttle.c
index
c5494e4
..
a3ea826
100644
(file)
--- a/
block/blk-throttle.c
+++ b/
block/blk-throttle.c
@@
-780,9
+780,11
@@
static bool tg_may_dispatch(struct throtl_grp *tg, struct bio *bio,
/*
* If previous slice expired, start a new one otherwise renew/extend
* existing slice to make sure it is at least throtl_slice interval
/*
* If previous slice expired, start a new one otherwise renew/extend
* existing slice to make sure it is at least throtl_slice interval
- * long since now.
+ * long since now. New slice is started only for empty throttle group.
+ * If there is queued bio, that means there should be an active
+ * slice and it should be extended instead.
*/
*/
- if (throtl_slice_used(tg, rw))
+ if (throtl_slice_used(tg, rw)
&& !(tg->service_queue.nr_queued[rw])
)
throtl_start_new_slice(tg, rw);
else {
if (time_before(tg->slice_end[rw], jiffies + throtl_slice))
throtl_start_new_slice(tg, rw);
else {
if (time_before(tg->slice_end[rw], jiffies + throtl_slice))
@@
-821,8
+823,8
@@
static void throtl_charge_bio(struct throtl_grp *tg, struct bio *bio)
* second time when it eventually gets issued. Set it when a bio
* is being charged to a tg.
*/
* second time when it eventually gets issued. Set it when a bio
* is being charged to a tg.
*/
- if (!(bio->bi_
rw
& REQ_THROTTLED))
- bio->bi_
rw
|= REQ_THROTTLED;
+ if (!(bio->bi_
opf
& REQ_THROTTLED))
+ bio->bi_
opf
|= REQ_THROTTLED;
}
/**
}
/**
@@
-1399,7
+1401,7
@@
bool blk_throtl_bio(struct request_queue *q, struct blkcg_gq *blkg,
WARN_ON_ONCE(!rcu_read_lock_held());
/* see throtl_charge_bio() */
WARN_ON_ONCE(!rcu_read_lock_held());
/* see throtl_charge_bio() */
- if ((bio->bi_
rw
& REQ_THROTTLED) || !tg->has_rules[rw])
+ if ((bio->bi_
opf
& REQ_THROTTLED) || !tg->has_rules[rw])
goto out;
spin_lock_irq(q->queue_lock);
goto out;
spin_lock_irq(q->queue_lock);
@@
-1478,7
+1480,7
@@
out:
* being issued.
*/
if (!throttled)
* being issued.
*/
if (!throttled)
- bio->bi_
rw
&= ~REQ_THROTTLED;
+ bio->bi_
opf
&= ~REQ_THROTTLED;
return throttled;
}
return throttled;
}