Skip to content

Commit

Permalink
block, bfq: turn put_queue into release_process_ref in __bfq_bic_chan…
Browse files Browse the repository at this point in the history
…ge_cgroup

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: [email protected]
Signed-off-by: Paolo Valente <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Algodev-github authored and axboe committed Mar 21, 2020
1 parent fd1bb3a commit c899773
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
5 changes: 1 addition & 4 deletions block/bfq-cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
2 changes: 0 additions & 2 deletions block/bfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
/*
Expand Down
1 change: 1 addition & 0 deletions block/bfq-iosched.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit c899773

Please sign in to comment.