summaryrefslogtreecommitdiff
path: root/block/bfq-wf2q.c
diff options
context:
space:
mode:
authorFam Zheng <zhengfeiran@bytedance.com>2019-08-28 06:54:51 +0300
committerJens Axboe <axboe@kernel.dk>2019-09-06 23:33:48 +0300
commite9d3c866bf4cdbb6637e6cb268c26dfdf06d8cd3 (patch)
treee5054d61888dcf6f15a42f89d5e0a3018601538b /block/bfq-wf2q.c
parenta26142559c2be8c0975b941e3110d23a9e552ce5 (diff)
downloadlinux-e9d3c866bf4cdbb6637e6cb268c26dfdf06d8cd3.tar.xz
bfq: Fix the missing barrier in __bfq_entity_update_weight_prio
The comment of bfq_group_set_weight says the reading of prio_changed should happen before the reading of weight, but a memory barrier is missing here. Add it now, to match the smp_wmb() there. Signed-off-by: Fam Zheng <zhengfeiran@bytedance.com> Reviewed-by: Paolo Valente <paolo.valente@linaro.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bfq-wf2q.c')
-rw-r--r--block/bfq-wf2q.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
index c9ba225081ce..05f0bf4a1144 100644
--- a/block/bfq-wf2q.c
+++ b/block/bfq-wf2q.c
@@ -744,6 +744,8 @@ __bfq_entity_update_weight_prio(struct bfq_service_tree *old_st,
}
#endif
+ /* Matches the smp_wmb() in bfq_group_set_weight. */
+ smp_rmb();
old_st->wsum -= entity->weight;
if (entity->new_weight != entity->orig_weight) {