public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cfq-iosched: Reduce linked group count upon group destruction
@ 2011-08-01 18:47 Vivek Goyal
  2011-08-02  7:24 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Vivek Goyal @ 2011-08-01 18:47 UTC (permalink / raw)
  To: linux kernel mailing list, Jens Axboe; +Cc: Israel G. Lugo

CFQ 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>
---
 block/cfq-iosched.c |    3 +++
 1 file changed, 3 insertions(+)

Index: linux-2.6/block/cfq-iosched.c
===================================================================
--- linux-2.6.orig/block/cfq-iosched.c	2011-08-01 14:03:31.859334421 -0400
+++ linux-2.6/block/cfq-iosched.c	2011-08-01 14:03:38.130618773 -0400
@@ -1209,6 +1209,9 @@ static void cfq_destroy_cfqg(struct cfq_
 
 	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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] cfq-iosched: Reduce linked group count upon group  destruction
  2011-08-01 18:47 [PATCH] cfq-iosched: Reduce linked group count upon group destruction Vivek Goyal
@ 2011-08-02  7:24 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2011-08-02  7:24 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: linux kernel mailing list, Israel G. Lugo

On 2011-08-01 20:47, Vivek Goyal wrote:
> CFQ 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.

Thanks Vivek, applied.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-02  7:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-01 18:47 [PATCH] cfq-iosched: Reduce linked group count upon group destruction Vivek Goyal
2011-08-02  7:24 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox