Skip to content

Commit

Permalink
block, bfq: release oom-queue ref to root group on exit
Browse files Browse the repository at this point in the history
On scheduler init, a reference to the root group, and a reference to
its corresponding blkg are taken for the oom queue. Yet these
references are not released on scheduler exit, which prevents these
objects from be freed. This commit adds the missing reference
releases.

Reported-by: Davide Ferrari <davideferrari8@gmail.com>
Tested-by: Holger Hoffstätte <holger@applied-asynchrony.com>
Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Algodev-github authored and axboe committed Jan 9, 2018
1 parent 52257ff commit 0d52af5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions block/bfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -4893,6 +4893,9 @@ static void bfq_exit_queue(struct elevator_queue *e)

hrtimer_cancel(&bfqd->idle_slice_timer);

/* release oom-queue reference to root group */
bfqg_and_blkg_put(bfqd->root_group);

#ifdef CONFIG_BFQ_GROUP_IOSCHED
blkcg_deactivate_policy(bfqd->queue, &blkcg_policy_bfq);
#else
Expand Down

0 comments on commit 0d52af5

Please sign in to comment.