Messages in this thread | | | Date | Thu, 15 Jan 2009 15:12:03 +0900 | From | KAMEZAWA Hiroyuki <> | Subject | Re: [RFC][PATCH 1/4] cgroup: support per cgroup subsys state ID (CSS ID) |
| |
Sorry for delayed reply.
On Mon, 12 Jan 2009 12:51:48 +0530 Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
> * KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2009-01-08 18:28:17]: > > There are several reasons to develop this. > > - Saving space .... For example, memcg's swap_cgroup is array of > > pointers to cgroup. But it is not necessary to be very fast. > > By replacing pointers(8bytes per ent) to ID (2byes per ent), we can > > reduce much amount of memory usage. > > 2 bytes per entry means that we restrict the entries to 2^16-1 for > number of cgroups, using a pointer introduces no such restriction. > 2^16-1 seems a reasonable number for now. > yes.
> > /* bits in struct cgroup_subsys_state flags field */ > > @@ -363,6 +367,11 @@ struct cgroup_subsys { > > int active; > > int disabled; > > int early_init; > > + /* > > + * True if this subsys uses ID. ID is not available before cgroup_init() > > + * (not available in early_init time.) > ^ period should come later sure.
; > > + /* > > + * Hierarchy of CSS ID belongs to. > > + */ > > + unsigned short stack[0]; /* Array of Length (depth+1) */ > > By maintaining the path up to the root here, is that how we avoid walking > through cgroups links? > yes. we can check this css is under hierarchy by
css->stack[root->depth] == root->id.
> > +/** > > * idr_replace - replace pointer for given id > > * @idp: idr handle > > * @ptr: pointer you want associated with the id > > > > Overall, I've taken a quick look and the patches seem OK. > thx,
-Kame
| |