Thread (11 messages) 11 messages, 2 authors, 2015-01-19

Re: [PATCH -mm v2 3/7] cgroup: release css->id after css_free

From: Tejun Heo <tj@kernel.org>
Date: 2015-01-19 14:30:09
Also in: linux-mm, lkml

On Mon, Jan 19, 2015 at 02:23:21PM +0300, Vladimir Davydov wrote:
Currently, we release css->id in css_release_work_fn, right before
calling css_free callback, so that when css_free is called, the id may
have already been reused for a new cgroup.

I am going to use css->id to create unique names for per memcg kmem
caches. Since kmem caches are destroyed only on css_free, I need css->id
to be freed after css_free was called to avoid name clashes. This patch
therefore moves css->id removal to css_free_work_fn. To prevent
css_from_id from returning a pointer to a stale css, it makes
css_release_work_fn replace the css ptr at css_idr:css->id with NULL.
I think it'd be better if you create a separate id for this purpose.
The requirement is pretty unusual and likely contradictory with other
usages.

Thanks.

-- 
tejun

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help