Re: [PATCH block/for-3.4/core] cfq: fix cfqg ref handling whenBLK_CGROUP && !CFQ_GROUP_IOSCHED

From: Tejun Heo
Date: Thu Mar 15 2012 - 12:51:06 EST


Hello,

On Thu, Mar 15, 2012 at 12:46:21PM -0400, Vivek Goyal wrote:
> On Thu, Mar 15, 2012 at 09:35:46AM -0700, Tejun Heo wrote:
>
> [..]
> > ---
> > Yeap, forgot to test that config combination. Fengguang, can you
> > please test this patch? Jens, once Fengguang confirms the fix, can
> > you please apply this on top of for-3.4/core along with the pending
> > stats updates?
>
> I was working on similar patch and you beat me to it. :-) One comment
> below.

:)

> [..]
> > @@ -3533,7 +3551,7 @@ static int cfq_init_queue(struct request
> >
> > spin_lock_irq(q->queue_lock);
> > cfq_link_cfqq_cfqg(&cfqd->oom_cfqq, cfqd->root_group);
> > - blkg_put(cfqg_to_blkg(cfqd->root_group));
> > + cfqg_put(cfqd->root_group);
>
> This seems to be a spurious cfqg_put()? Which reference we are putting
> down here?

The extra ref from cfq_link_cfqq_cfqg() for oom_cfqq; otherwise, we
need an extra cfq_put() in cfq_exit_queue(). I thought I wrote
comment about that somewhere. Hmmm.... apparently not. The thing is
that oom_cfqq doesn't go through proper cfqq destruction and thus
never puts the extra ref to root cfqg.

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/