[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090427.211533.115916003.ryov@valinux.co.jp>
Date: Mon, 27 Apr 2009 21:15:33 +0900 (JST)
From: Ryo Tsuruta <ryov@...inux.co.jp>
To: righi.andrea@...il.com
Cc: randy.dunlap@...cle.com, menage@...gle.com, chlunde@...g.uio.no,
eric.rannaud@...il.com, balbir@...ux.vnet.ibm.com,
fernando@....ntt.co.jp, dradford@...ehost.com, agk@...rceware.org,
subrata@...ux.vnet.ibm.com, axboe@...nel.dk,
akpm@...ux-foundation.org, containers@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org, dave@...ux.vnet.ibm.com,
matt@...ehost.com, roberto@...it.it, ngupta@...gle.com
Subject: Re: [PATCH 1/9] io-throttle documentation
Hi Kamezawa-san,
> I've come up with an idea to coexist blkio-cgroup and io-throttle.
> blkio-cgroup provides a function to get a cgroup with the specified ID.
>
> /* Should be called under rcu_read_lock() */
> struct cgroup *blkio_cgroup_lookup(int id)
> {
> struct cgroup *cgrp;
> struct cgroup_subsys_state *css;
>
> if (blkio_cgroup_disabled())
> return NULL;
>
> css = css_lookup(&blkio_cgroup_subsys, id);
> if (!css)
> return NULL;
> cgrp = css->cgroup;
> return cgrp;
> }
>
> Then io-throttle can get a struct iothrottle which belongs to the
> cgroup by using the above function.
>
> static struct iothrottle *iothrottle_lookup(int id)
> {
> struct cgroup *grp;
> struct iothrottle *iot;
>
> ...
> grp = blkio_cgroup_lookup(id);
> if (!grp)
> return NULL
> iot = cgroup_to_iothrottle(grp);
> ...
> }
>
> What do you think about this way?
I have some questions.
- How about using the same numbering scheme as process ID for css_id
instead of idr? It prevents the same ID from being resued quickly.
- Why are css_ids assigned per css? If each cgroup has a unique ID and
the subsystems can refer to it, I can make the above code simple.
Thanks,
Ryo Tsuruta
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists