Skip to content

Commit

Permalink
cfq-iosched: Reduce linked group count upon group destruction
Browse files Browse the repository at this point in the history
FQ keeps track of number of groups which are linked on blkcg->blkg_list.
This is useful to avoid races between queue exit and cgroup exit code
paths. So if at the request queue exit time linked group count is not
zero, that means there are some group out there which is yet to be
deleted under rcu read period and queue exit code should wait for
on rcu period.

In my previous patch I forgot to decrease the number of group count.
So in current form, we nr_blkcg_linked_grps is always non-zero and
we will always wait one rcu period (if BLK_CGROUP=y). The side effect
of this is that it can increase boot time. I am surprised, nobody
complained so far.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
  • Loading branch information
Vivek Goyal authored and Jens Axboe committed Aug 2, 2011
1 parent e5a94f5 commit a5395b8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,9 @@ static void cfq_destroy_cfqg(struct cfq_data *cfqd, struct cfq_group *cfqg)

hlist_del_init(&cfqg->cfqd_node);

BUG_ON(cfqd->nr_blkcg_linked_grps <= 0);
cfqd->nr_blkcg_linked_grps--;

/*
* Put the reference taken at the time of creation so that when all
* queues are gone, group can be destroyed.
Expand Down

0 comments on commit a5395b8

Please sign in to comment.