Re: [PATCH] cgroup: protect modifications to cgroup_idr with cgroup_mutex

2014-02-12 Thread Michal Hocko
On Wed 12-02-14 17:26:40, Li Zefan wrote: > On 2014/2/12 17:12, Michal Hocko wrote: > > Li has pointed out that my previous backport was not correct because > > err_unlock label releases a reference to supperblock which was not taken > > before idr_alloc. I've also removed cgroup_mutex from free_cs

Re: [PATCH] cgroup: protect modifications to cgroup_idr with cgroup_mutex

2014-02-12 Thread Li Zefan
On 2014/2/12 17:12, Michal Hocko wrote: > Li has pointed out that my previous backport was not correct because > err_unlock label releases a reference to supperblock which was not taken > before idr_alloc. I've also removed cgroup_mutex from free_css_id as per > Li. > Fixed in this version. > Loo

Re: [PATCH] cgroup: protect modifications to cgroup_idr with cgroup_mutex

2014-02-12 Thread Michal Hocko
Li has pointed out that my previous backport was not correct because err_unlock label releases a reference to supperblock which was not taken before idr_alloc. I've also removed cgroup_mutex from free_css_id as per Li. Fixed in this version. --- Date: Tue, 11 Feb 2014 16:05:46 +0800 From: Li Zefa

Re: [PATCH] cgroup: protect modifications to cgroup_idr with cgroup_mutex

2014-02-11 Thread Li Zefan
On 2014/2/11 18:20, Michal Hocko wrote: > Hi Li, > good work in reproducing the issue so quickly! > I have tried to backport this patch to 3.12 kernel but the code has > changed since then. > The only two instances of idr_remove which are called outside of > cgroup_mutex seem to be: > - cgroup_cre

Re: [PATCH] cgroup: protect modifications to cgroup_idr with cgroup_mutex

2014-02-11 Thread Tejun Heo
On Tue, Feb 11, 2014 at 04:05:46PM +0800, Li Zefan wrote: > Setup cgroupfs like this: > # mount -t cgroup -o cpuacct xxx /cgroup > # mkdir /cgroup/sub1 > # mkdir /cgroup/sub2 > > Then run these two commands: > # for ((; ;)) { mkdir /cgroup/sub1/tmp && rmdir /mnt/sub1/tmp; } & > # for ((;

Re: [PATCH] cgroup: protect modifications to cgroup_idr with cgroup_mutex

2014-02-11 Thread Michal Hocko
Hi Li, good work in reproducing the issue so quickly! I have tried to backport this patch to 3.12 kernel but the code has changed since then. The only two instances of idr_remove which are called outside of cgroup_mutex seem to be: - cgroup_create calling it from err_free_id: path - css_free_work

[PATCH] cgroup: protect modifications to cgroup_idr with cgroup_mutex

2014-02-11 Thread Li Zefan
Setup cgroupfs like this: # mount -t cgroup -o cpuacct xxx /cgroup # mkdir /cgroup/sub1 # mkdir /cgroup/sub2 Then run these two commands: # for ((; ;)) { mkdir /cgroup/sub1/tmp && rmdir /mnt/sub1/tmp; } & # for ((; ;)) { mkdir /cgroup/sub2/tmp && rmdir /mnt/sub2/tmp; } & After seconds y