block, bfq: turn put_queue into release_process_ref in __bfq_bic_change_cgroup
authorPaolo Valente <paolo.valente@linaro.org>
Sat, 21 Mar 2020 09:45:19 +0000 (10:45 +0100)
committerJens Axboe <axboe@kernel.dk>
Sat, 21 Mar 2020 20:31:00 +0000 (14:31 -0600)
A bfq_put_queue() may be invoked in __bfq_bic_change_cgroup(). The
goal of this put is to release a process reference to a bfq_queue. But
process-reference releases may trigger also some extra operation, and,
to this goal, are handled through bfq_release_process_ref(). So, turn
the invocation of bfq_put_queue() into an invocation of
bfq_release_process_ref().

Tested-by: cki-project@redhat.com
Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bfq-cgroup.c
block/bfq-iosched.c
block/bfq-iosched.h

index 9d963ed518d1f218e1dcab66ab53f36c2e39df5c..72c6151ace96c4e09a4150540d3dd4bd4754aa8c 100644 (file)
@@ -714,10 +714,7 @@ static struct bfq_group *__bfq_bic_change_cgroup(struct bfq_data *bfqd,
 
                if (entity->sched_data != &bfqg->sched_data) {
                        bic_set_bfqq(bic, NULL, 0);
-                       bfq_log_bfqq(bfqd, async_bfqq,
-                                    "bic_change_group: %p %d",
-                                    async_bfqq, async_bfqq->ref);
-                       bfq_put_queue(async_bfqq);
+                       bfq_release_process_ref(bfqd, async_bfqq);
                }
        }
 
index 4a44c7f19435326127031603f5735d22b7a41ca3..78ba57efd16b5fe3dca4af5108c7e7cce46b2def 100644 (file)
@@ -2716,8 +2716,6 @@ static void bfq_bfqq_save_state(struct bfq_queue *bfqq)
        }
 }
 
-
-static
 void bfq_release_process_ref(struct bfq_data *bfqd, struct bfq_queue *bfqq)
 {
        /*
index d1233af9c6844d0578ed8f8a29ef37d63e244aaf..cd224aaf9f52a541e8851b5f7cb92c7008b3bcf1 100644 (file)
@@ -955,6 +955,7 @@ void bfq_bfqq_expire(struct bfq_data *bfqd, struct bfq_queue *bfqq,
                     bool compensate, enum bfqq_expiration reason);
 void bfq_put_queue(struct bfq_queue *bfqq);
 void bfq_end_wr_async_queues(struct bfq_data *bfqd, struct bfq_group *bfqg);
+void bfq_release_process_ref(struct bfq_data *bfqd, struct bfq_queue *bfqq);
 void bfq_schedule_dispatch(struct bfq_data *bfqd);
 void bfq_put_async_queues(struct bfq_data *bfqd, struct bfq_group *bfqg);