From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: [PATCH 2/8] cgroup: kill CSS_REMOVED Date: Wed, 31 Oct 2012 10:44:20 -0700 Message-ID: <20121031174420.GL2945@htj.dyndns.org> References: <1351657365-25055-1-git-send-email-tj@kernel.org> <1351657365-25055-3-git-send-email-tj@kernel.org> <20121031153926.GC22809@dhcp22.suse.cz> <20121031165739.GE2945@htj.dyndns.org> <50915A87.4070504@parallels.com> <50915DB7.5020706@parallels.com> <20121031172522.GJ2945@htj.dyndns.org> <50916218.3090301@parallels.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <50916218.3090301-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Glauber Costa Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Michal Hocko , hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org List-Id: containers.vger.kernel.org Hello, Glauber. On Wed, Oct 31, 2012 at 09:38:32PM +0400, Glauber Costa wrote: > Because I am allocating an array big enough to hold one entry per memcg. > The natural array index for this, is the css_id. Obviously, I don't want > this array to have 65k entries in size, so I resize it (doubling every > time) Because I don't know the css_id at this time, I have to do it later. > > Another option for this - which I also considered - would be to use a > different index. We get more packing, since not all memcgs will be kmem > limited (and the index would contain only the kmem limited memcgs), and > we can allocate this index during ->create(). > > I initially picked the css_index because I though a specialized index > might be confusing. But if you feel strongly about all the allocations > happening inside ->create(), this would be a way to avoid it. Would you > prefer that? I'll think more about it. The whole css_id thing might need some soul searching too anyway. Let's continue this one your patch thread. Thanks. -- tejun