Re: [PATCH 08/20] blkio: Add support for dynamic creation of cfq_groups

From: Jeff Moyer
Date: Wed Nov 04 2009 - 11:02:19 EST


Vivek Goyal <vgoyal@xxxxxxxxxx> writes:

> + /* Do we need to take this reference */
> + if (!css_tryget(&blkcg->css))
> + return NULL;;

Interesting question. It seems like, so long as you want to reference
that cgroup, you need a reference on it. ->alloc will only give you
one, so as long as we have pointers to these squirreled away, we need to
bump the reference count. Please take a look at this before your next
posting.

> +
> + cfqg = cfqg_of_blkg(blkiocg_lookup_group(blkcg, key));
> + if (cfqg || !create)
> + goto done;
> +
> + cfqg = kzalloc_node(sizeof(*cfqg), GFP_ATOMIC | __GFP_ZERO,
> + cfqd->queue->node);
Do you really have to OR in __GFP_ZERO for kzalloc?

> + cfqg = cfq_find_alloc_cfqg(cfqd, cgroup, create);
> + if (!cfqg && create)
> + cfqg = &cfqd->root_group;

Hmm, is that really the behaviour you want?

Cheers,
Jeff
--
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/