Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1723873
| From | Paolo Valente <paolo.valente@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH BUGFIX/IMPROVEMENT V2 2/3] block, bfq: remove direct switch to an entity in higher class |
| Date | 2017-08-31 08:50 +0200 |
| Message-ID | <ukrsB-2c1-17@gated-at.bofh.it> (permalink) |
| References | <ukrsB-2c1-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
If the function bfq_update_next_in_service is invoked as a consequence
of the activation or requeueing of an entity, say E, and finds out
that E belongs to a higher-priority class than that of the current
next-in-service entity, then it sets next_in_service directly to
E. But this may lead to anomalous schedules, because E may happen not
be eligible for service, because its virtual start time is higher than
the system virtual time for its service tree.
This commit addresses this issue by simply removing this direct
switch.
Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
Tested-by: Lee Tibbert <lee.tibbert@gmail.com>
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
---
block/bfq-wf2q.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
index 138732e..eeaf326 100644
--- a/block/bfq-wf2q.c
+++ b/block/bfq-wf2q.c
@@ -86,9 +86,8 @@ static bool bfq_update_next_in_service(struct bfq_sched_data *sd,
* or repositiong of an entity that does not coincide with
* sd->next_in_service, then a full lookup in the active tree
* can be avoided. In fact, it is enough to check whether the
- * just-modified entity has a higher priority than
- * sd->next_in_service, or, even if it has the same priority
- * as sd->next_in_service, is eligible and has a lower virtual
+ * just-modified entity has the same priority as
+ * sd->next_in_service, is eligible and has a lower virtual
* finish time than sd->next_in_service. If this compound
* condition holds, then the new entity becomes the new
* next_in_service. Otherwise no change is needed.
@@ -104,9 +103,8 @@ static bool bfq_update_next_in_service(struct bfq_sched_data *sd,
/*
* If there is already a next_in_service candidate
- * entity, then compare class priorities or timestamps
- * to decide whether to replace sd->service_tree with
- * new_entity.
+ * entity, then compare timestamps to decide whether
+ * to replace sd->service_tree with new_entity.
*/
if (next_in_service) {
unsigned int new_entity_class_idx =
@@ -114,10 +112,6 @@ static bool bfq_update_next_in_service(struct bfq_sched_data *sd,
struct bfq_service_tree *st =
sd->service_tree + new_entity_class_idx;
- /*
- * For efficiency, evaluate the most likely
- * sub-condition first.
- */
replace_next =
(new_entity_class_idx ==
bfq_class_idx(next_in_service)
@@ -125,10 +119,7 @@ static bool bfq_update_next_in_service(struct bfq_sched_data *sd,
!bfq_gt(new_entity->start, st->vtime)
&&
bfq_gt(next_in_service->finish,
- new_entity->finish))
- ||
- new_entity_class_idx <
- bfq_class_idx(next_in_service);
+ new_entity->finish));
}
if (replace_next)
--
2.10.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH BUGFIX/IMPROVEMENT V2 0/3] three bfq fixes restoring service guarantees with random sync writes in bg Paolo Valente <paolo.valente@linaro.org> - 2017-08-31 08:50 +0200
[PATCH BUGFIX/IMPROVEMENT V2 1/3] block, bfq: make lookup_next_entity push up vtime on expirations Paolo Valente <paolo.valente@linaro.org> - 2017-08-31 08:50 +0200
[PATCH BUGFIX/IMPROVEMENT V2 3/3] block, bfq: guarantee update_next_in_service always returns an eligible entity Paolo Valente <paolo.valente@linaro.org> - 2017-08-31 08:50 +0200
[PATCH BUGFIX/IMPROVEMENT V2 2/3] block, bfq: remove direct switch to an entity in higher class Paolo Valente <paolo.valente@linaro.org> - 2017-08-31 08:50 +0200
Re: [PATCH BUGFIX/IMPROVEMENT V2 0/3] three bfq fixes restoring service guarantees with random sync writes in bg Jens Axboe <axboe@kernel.dk> - 2017-08-31 16:30 +0200
Re: [PATCH BUGFIX/IMPROVEMENT V2 0/3] three bfq fixes restoring service guarantees with random sync writes in bg Mel Gorman <mgorman@techsingularity.net> - 2017-08-31 16:50 +0200
Re: [PATCH BUGFIX/IMPROVEMENT V2 0/3] three bfq fixes restoring service guarantees with random sync writes in bg Mike Galbraith <efault@gmx.de> - 2017-08-31 19:10 +0200
Re: [PATCH BUGFIX/IMPROVEMENT V2 0/3] three bfq fixes restoring service guarantees with random sync writes in bg Paolo Valente <paolo.valente@linaro.org> - 2017-08-31 19:20 +0200
Re: [PATCH BUGFIX/IMPROVEMENT V2 0/3] three bfq fixes restoring service guarantees with random sync writes in bg Mike Galbraith <efault@gmx.de> - 2017-08-31 19:40 +0200
Re: [PATCH BUGFIX/IMPROVEMENT V2 0/3] three bfq fixes restoring service guarantees with random sync writes in bg Mel Gorman <mgorman@techsingularity.net> - 2017-09-04 10:20 +0200
Re: [PATCH BUGFIX/IMPROVEMENT V2 0/3] three bfq fixes restoring service guarantees with random sync writes in bg Paolo Valente <paolo.valente@linaro.org> - 2017-09-04 11:00 +0200
Re: [PATCH BUGFIX/IMPROVEMENT V2 0/3] three bfq fixes restoring service guarantees with random sync writes in bg Ming Lei <tom.leiming@gmail.com> - 2017-09-04 11:10 +0200
csiph-web